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

Unified Diff: chrome/browser/app_menu_model.h

Issue 523147: Made MenuController handle dynamic labels. (Closed)
Patch Set: Addressed pinkerton's comments. Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/app_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_menu_model.h
diff --git a/chrome/browser/app_menu_model.h b/chrome/browser/app_menu_model.h
index 41343d40f6cb09108ce5db98de316aead3550a86..5dc5d443780effc1ffb955301ad0711b5ab07d19 100644
--- a/chrome/browser/app_menu_model.h
+++ b/chrome/browser/app_menu_model.h
@@ -20,15 +20,26 @@ class AppMenuModel : public menus::SimpleMenuModel {
Browser* browser);
virtual ~AppMenuModel();
+ // Override this to handle the sync menu item (whose label is
+ // updated dynamically).
+ virtual bool IsLabelDynamicAt(int index) const;
+ virtual string16 GetLabelAt(int index) const;
+
private:
void Build();
void BuildProfileSubMenu();
+ string16 GetSyncMenuLabel() const;
+ bool IsSyncItem(int index) const;
+
// Contents of the profiles menu to populate with profile names.
scoped_ptr<menus::SimpleMenuModel> profiles_menu_contents_;
Browser* browser_; // weak
+ bool sync_item_enabled_;
+ int sync_item_index_; // -1 if sync_item_enabled_ is false.
+
DISALLOW_COPY_AND_ASSIGN(AppMenuModel);
};
« no previous file with comments | « no previous file | chrome/browser/app_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698