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

Unified Diff: chrome/browser/wrench_menu_model.cc

Issue 3858002: Show "Update Chrome OS" in the wrench menu, when the update image is ready. (Closed)
Patch Set: bubble Created 10 years, 2 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/views/update_recommended_message_box.cc ('k') | chrome/chrome_browser.gypi » ('j') | 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 d308a4dd0684ec738f32ae03dd929728f776a9ba..8b77a4e122d04169fcef2bc79c884f802823da46 100644
--- a/chrome/browser/wrench_menu_model.cc
+++ b/chrome/browser/wrench_menu_model.cc
@@ -44,6 +44,11 @@
#include "chrome/browser/browser_window.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/update_library.h"
+#endif
+
////////////////////////////////////////////////////////////////////////////////
// EncodingMenuModel
@@ -258,8 +263,14 @@ bool WrenchMenuModel::IsCommandIdEnabled(int command_id) const {
}
bool WrenchMenuModel::IsCommandIdVisible(int command_id) const {
- if (command_id == IDC_UPGRADE_DIALOG)
+ if (command_id == IDC_UPGRADE_DIALOG) {
+#if defined(OS_CHROMEOS)
+ return (chromeos::CrosLibrary::Get()->GetUpdateLibrary()->status().status
+ == chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT);
+#else
return Singleton<UpgradeDetector>::get()->notify_upgrade();
+#endif
+ }
return true;
}
@@ -383,14 +394,19 @@ void WrenchMenuModel::Build() {
#endif
}
+#if defined(OS_CHROMEOS)
+ const string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME);
+#else
+ const string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
+#endif
// 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)));
+ IDS_ABOUT, product_name));
}
AddItem(IDC_UPGRADE_DIALOG, l10n_util::GetStringFUTF16(
- IDS_UPDATE_NOW, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ IDS_UPDATE_NOW, product_name));
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
SetIcon(GetIndexOfCommandId(IDC_UPGRADE_DIALOG),
*rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE));
« no previous file with comments | « chrome/browser/views/update_recommended_message_box.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698