Index: chrome/browser/ui/toolbar/wrench_menu_model.h |
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h |
index 9d5ff90e1b0852b66afdc78ad295c30582546fd8..889a71f0ac61f767c0fa5a9ed8d93dccf8053f7a 100644 |
--- a/chrome/browser/ui/toolbar/wrench_menu_model.h |
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.h |
@@ -6,6 +6,7 @@ |
#define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
#pragma once |
+#include "base/file_path.h" |
#include "base/memory/scoped_ptr.h" |
#include "chrome/browser/tabs/tab_strip_model_observer.h" |
#include "content/common/notification_observer.h" |
@@ -81,6 +82,34 @@ class BookmarkSubMenuModel : public ui::SimpleMenuModel { |
DISALLOW_COPY_AND_ASSIGN(BookmarkSubMenuModel); |
}; |
+class ProfilesSubMenuModel : public ui::SimpleMenuModel, |
sky
2011/06/10 16:24:14
Does this really need to be in the header?
|
+ public ui::SimpleMenuModel::Delegate { |
+ public: |
+ ProfilesSubMenuModel(ui::SimpleMenuModel::Delegate* delegate, |
+ Browser* browser); |
+ |
+ virtual void ExecuteCommand(int command_id) OVERRIDE; |
+ virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
+ virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
+ virtual bool GetAcceleratorForCommandId( |
+ int command_id, |
+ ui::Accelerator* accelerator) OVERRIDE; |
+ |
+ private: |
+ enum { |
+ COMMAND_SWITCH_TO_PROFILE, |
+ }; |
+ |
+ void Build(); |
+ void GetProfileOnIOThread(FilePath profile_path); |
sky
2011/06/10 16:24:14
const FilePath& (and on next line).
Also, add desc
|
+ void OpenWindowWithProfile(FilePath profile_path); |
+ |
+ Browser* browser_; // weak |
+ ui::SimpleMenuModel::Delegate* delegate_; // weak |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ProfilesSubMenuModel); |
+}; |
+ |
// A menu model that builds the contents of the wrench menu. |
class WrenchMenuModel : public ui::SimpleMenuModel, |
public ui::SimpleMenuModel::Delegate, |
@@ -136,6 +165,8 @@ class WrenchMenuModel : public ui::SimpleMenuModel, |
void Build(); |
+ void AddProfilesMenuItemAt(int index); |
+ |
// Adds custom items to the menu. Deprecated in favor of a cross platform |
// model for button items. |
void CreateCutCopyPaste(); |
@@ -156,6 +187,9 @@ class WrenchMenuModel : public ui::SimpleMenuModel, |
// Bookmark submenu. |
scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; |
+ // Profiles submenu. |
+ scoped_ptr<ProfilesSubMenuModel> profiles_sub_menu_model_; |
+ |
ui::AcceleratorProvider* provider_; // weak |
Browser* browser_; // weak |