nsDeckFrame::nsDeckFrame(nsStyleContext* aContext) : nsBoxFrame(aContext), mIndex(0) { nsCOMPtr<nsBoxLayout> layout; NS_NewStackLayout(layout); SetLayoutManager(layout); }
nsDeckFrame::nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) : nsBoxFrame(aPresShell, aContext), mIndex(0) { nsCOMPtr<nsIBoxLayout> layout; NS_NewStackLayout(aPresShell, layout); SetLayoutManager(layout); }
nsRootBoxFrame::nsRootBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext): nsBoxFrame(aShell, aContext, true) { mPopupSetFrame = nsnull; nsCOMPtr<nsBoxLayout> layout; NS_NewStackLayout(aShell, layout); SetLayoutManager(layout); }
AppContainer::AppContainer() : bounds_animator_(this), show_(true) { bounds_animator_.AddObserver(this); SetLayoutManager(new AppLayout(10, 10, 10)); for(int i=0; i<arraysize(app_infos); ++i) { AddChildView(new AppView(app_infos[i].icon_res_id, app_infos[i].app_name)); } }
AppView::AppView(int res_id, const std::wstring& app_name) { views::GridLayout* layout = new views::GridLayout(this); SetLayoutManager(layout); views::ColumnSet* column_set = layout->AddColumnSet(0); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 0.0f, views::GridLayout::USE_PREF, 0, 0); layout->StartRow(0.0f, 0); views::ImageView* image = new views::ImageView(); image->SetImage( ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(res_id)); layout->AddView(image); layout->StartRow(0.0f, 0); views::Label* label = new views::Label(app_name); layout->AddView(label); }
void TabContentsContainer::ChangeTabContents(TabContents* contents) { if(tab_contents_) { view::View *v = (tab_contents_->puttyView()); tab_contents_->WasHidden(); RemoveChildView(v); RemoveObservers(); } tab_contents_ = contents; // When detaching the last tab of the browser ChangeTabContents is invoked // with NULL. Don't attempt to do anything in that case. if(tab_contents_) { view::View *v = (contents->puttyView()); AddChildView(v); SetLayoutManager(new view::FillLayout()); Layout(); AddObservers(); tab_contents_->ShowContents(); } }