Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/views/toolbar_view.cc

Issue 501168: Make back forward menu model a MenuModel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/toolbar_view.h" 5 #include "chrome/browser/views/toolbar_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/drag_drop_types.h" 9 #include "app/drag_drop_types.h"
10 #include "app/gfx/canvas.h" 10 #include "app/gfx/canvas.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 else 103 else
104 display_mode_ = DISPLAYMODE_LOCATION; 104 display_mode_ = DISPLAYMODE_LOCATION;
105 105
106 if (!kPopupBackgroundEdge) { 106 if (!kPopupBackgroundEdge) {
107 kPopupBackgroundEdge = ResourceBundle::GetSharedInstance().GetBitmapNamed( 107 kPopupBackgroundEdge = ResourceBundle::GetSharedInstance().GetBitmapNamed(
108 IDR_LOCATIONBG_POPUPMODE_EDGE); 108 IDR_LOCATIONBG_POPUPMODE_EDGE);
109 } 109 }
110 } 110 }
111 111
112 void ToolbarView::Init(Profile* profile) { 112 void ToolbarView::Init(Profile* profile) {
113 back_menu_model_.reset(new BackForwardMenuModelViews( 113 back_menu_model_.reset(new BackForwardMenuModel(
114 browser_, BackForwardMenuModel::BACKWARD_MENU, GetWidget())); 114 browser_, BackForwardMenuModel::BACKWARD_MENU));
115 forward_menu_model_.reset(new BackForwardMenuModelViews( 115 forward_menu_model_.reset(new BackForwardMenuModel(
116 browser_, BackForwardMenuModel::FORWARD_MENU, GetWidget())); 116 browser_, BackForwardMenuModel::FORWARD_MENU));
117 117
118 // Create all the individual Views in the Toolbar. 118 // Create all the individual Views in the Toolbar.
119 CreateLeftSideControls(); 119 CreateLeftSideControls();
120 CreateCenterStack(profile); 120 CreateCenterStack(profile);
121 CreateRightSideControls(profile); 121 CreateRightSideControls(profile);
122 122
123 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this); 123 show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this);
124 124
125 SetProfile(profile); 125 SetProfile(profile);
126 } 126 }
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 page_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); 728 page_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
729 } 729 }
730 730
731 void ToolbarView::RunAppMenu(const gfx::Point& pt) { 731 void ToolbarView::RunAppMenu(const gfx::Point& pt) {
732 // We always rebuild the app menu so that we can get the current state of 732 // We always rebuild the app menu so that we can get the current state of
733 // the sync system. 733 // the sync system.
734 app_menu_model_.reset(new AppMenuModel(this, browser_)); 734 app_menu_model_.reset(new AppMenuModel(this, browser_));
735 app_menu_menu_.reset(new views::Menu2(app_menu_model_.get())); 735 app_menu_menu_.reset(new views::Menu2(app_menu_model_.get()));
736 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); 736 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
737 } 737 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698