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

Unified Diff: chrome/browser/wrench_menu_model.cc

Issue 3143046: The "Update Chrome" menu item should appear in addition to the About menu. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: estade fixes -> final try Created 10 years, 4 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 | « chrome/browser/wrench_menu_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/wrench_menu_model.cc
diff --git a/chrome/browser/wrench_menu_model.cc b/chrome/browser/wrench_menu_model.cc
index 395854636899087f7e651c40c7370a8d5e071a33..abea856a51dd190d84ba1eaf85ee836905c513c8 100644
--- a/chrome/browser/wrench_menu_model.cc
+++ b/chrome/browser/wrench_menu_model.cc
@@ -194,17 +194,14 @@ WrenchMenuModel::~WrenchMenuModel() {
bool WrenchMenuModel::IsLabelForCommandIdDynamic(int command_id) const {
return command_id == IDC_ZOOM_PERCENT_DISPLAY ||
- command_id == IDC_SYNC_BOOKMARKS ||
#if defined(OS_MACOSX)
command_id == IDC_FULLSCREEN ||
#endif
- command_id == IDC_ABOUT;
+ command_id == IDC_SYNC_BOOKMARKS;
}
string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
switch (command_id) {
- case IDC_ABOUT:
- return GetAboutEntryMenuLabel();
case IDC_SYNC_BOOKMARKS:
return GetSyncMenuLabel();
case IDC_ZOOM_PERCENT_DISPLAY:
@@ -246,6 +243,12 @@ bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const {
return browser_->command_updater()->IsCommandEnabled(command_id);
}
+bool WrenchMenuModel::IsCommandIdVisible(int command_id) const {
+ if (command_id == IDC_UPGRADE_DIALOG)
+ return Singleton<UpgradeDetector>::get()->notify_upgrade();
+ return true;
+}
+
bool WrenchMenuModel::GetAcceleratorForCommandId(
int command_id,
menus::Accelerator* accelerator) {
@@ -366,24 +369,18 @@ void WrenchMenuModel::Build() {
IDS_TAB_CXMENU_USE_VERTICAL_TABS);
#endif
- // TODO(erg): This entire section needs to be reworked and is out of scope of
- // the first cleanup patch I'm doing. Part 1 (crbug.com/47320) is moving most
- // of the logic from each platform specific UI code into the model here. Part
- // 2 (crbug.com/46221) is normalizing the about menu item/hidden update menu
- // item behaviour across the three platforms.
-
- // On Mac, there is no About item unless it is replaced with the update
- // available notification.
- if (browser_defaults::kShowAboutMenuItem ||
- Singleton<UpgradeDetector>::get()->notify_upgrade()) {
- AddItem(IDC_ABOUT,
- l10n_util::GetStringFUTF16(
- IDS_ABOUT,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
- // ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- // SetIcon(GetIndexOfCommandId(IDC_ABOUT),
- // *rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE));
+ // On Mac, there is no About item.
+ if (browser_defaults::kShowAboutMenuItem) {
+ AddItem(IDC_ABOUT, l10n_util::GetStringFUTF16(
+ IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
}
+
+ AddItem(IDC_UPGRADE_DIALOG, l10n_util::GetStringFUTF16(
+ IDS_UPDATE_NOW, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ SetIcon(GetIndexOfCommandId(IDC_UPGRADE_DIALOG),
+ *rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE));
+
AddItemWithStringId(IDC_HELP_PAGE, IDS_HELP_PAGE);
if (browser_defaults::kShowExitMenuItem) {
AddSeparator();
@@ -443,12 +440,3 @@ string16 WrenchMenuModel::GetSyncMenuLabel() const {
return sync_ui_util::GetSyncMenuLabel(
browser_->profile()->GetOriginalProfile()->GetProfileSyncService());
}
-
-string16 WrenchMenuModel::GetAboutEntryMenuLabel() const {
- if (Singleton<UpgradeDetector>::get()->notify_upgrade()) {
- return l10n_util::GetStringFUTF16(
- IDS_UPDATE_NOW, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
- }
- return l10n_util::GetStringFUTF16(
- IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
-}
« no previous file with comments | « chrome/browser/wrench_menu_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698