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

Unified Diff: chrome/browser/views/toolbar_view.h

Issue 465130: Share the code that builds the page menu in a common model, make Mac and Win ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/page_menu_model_unittest.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/toolbar_view.h
===================================================================
--- chrome/browser/views/toolbar_view.h (revision 33827)
+++ chrome/browser/views/toolbar_view.h (working copy)
@@ -12,6 +12,7 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/bubble_positioner.h"
#include "chrome/browser/command_updater.h"
+#include "chrome/browser/page_menu_model.h"
#include "chrome/browser/user_data_manager.h"
#include "chrome/browser/views/accessible_toolbar_view.h"
#include "chrome/browser/views/go_button.h"
@@ -32,39 +33,6 @@
class Menu2;
}
-// A menu model that builds the contents of an encoding menu.
-class EncodingMenuModel : public menus::SimpleMenuModel,
- public menus::SimpleMenuModel::Delegate {
- public:
- explicit EncodingMenuModel(Browser* browser);
- virtual ~EncodingMenuModel() {}
-
- // Overridden from menus::SimpleMenuModel::Delegate:
- virtual bool IsCommandIdChecked(int command_id) const;
- virtual bool IsCommandIdEnabled(int command_id) const;
- virtual bool GetAcceleratorForCommandId(int command_id,
- menus::Accelerator* accelerator);
- virtual void ExecuteCommand(int command_id);
-
- private:
- void Build();
-
- Browser* browser_;
-
- DISALLOW_COPY_AND_ASSIGN(EncodingMenuModel);
-};
-
-class ZoomMenuModel : public menus::SimpleMenuModel {
- public:
- explicit ZoomMenuModel(menus::SimpleMenuModel::Delegate* delegate);
- virtual ~ZoomMenuModel() {}
-
- private:
- void Build();
-
- DISALLOW_COPY_AND_ASSIGN(ZoomMenuModel);
-};
-
// The Browser Window's toolbar.
class ToolbarView : public AccessibleToolbarView,
public views::ViewMenuDelegate,
@@ -175,12 +143,6 @@
void RunPageMenu(const gfx::Point& pt);
void RunAppMenu(const gfx::Point& pt);
- void CreatePageMenu();
- void CreateZoomMenuContents();
- void CreateEncodingMenuContents();
-#if defined(OS_WIN)
- void CreateDevToolsMenuContents();
-#endif
void CreateAppMenu();
// Types of display mode this toolbar can have.
@@ -228,10 +190,7 @@
DisplayMode display_mode_;
// The contents of the various menus.
- scoped_ptr<menus::SimpleMenuModel> page_menu_contents_;
- scoped_ptr<ZoomMenuModel> zoom_menu_contents_;
- scoped_ptr<EncodingMenuModel> encoding_menu_contents_;
- scoped_ptr<menus::SimpleMenuModel> devtools_menu_contents_;
+ scoped_ptr<PageMenuModel> page_menu_model_;
scoped_ptr<menus::SimpleMenuModel> app_menu_contents_;
// TODO(beng): build these into MenuButton.
« no previous file with comments | « chrome/browser/page_menu_model_unittest.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698