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

Unified Diff: chrome/browser/dom_ui/options/about_page_handler.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/dom_ui/options/about_page_handler.h ('k') | chrome/browser/resources/options/about_page.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/options/about_page_handler.cc
diff --git a/chrome/browser/dom_ui/options/about_page_handler.cc b/chrome/browser/dom_ui/options/about_page_handler.cc
index cece7a3c7bec0ab75b18769f20e711ccd5f35748..902e71a90bfcfac2f48faa0c5f37449e875c45f1 100644
--- a/chrome/browser/dom_ui/options/about_page_handler.cc
+++ b/chrome/browser/dom_ui/options/about_page_handler.cc
@@ -33,6 +33,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/power_library.h"
#include "chrome/browser/chromeos/cros/update_library.h"
#endif
@@ -66,6 +67,7 @@ const LocalizeEntry localize_table[] = {
{ "loading", IDS_ABOUT_PAGE_LOADING },
{ "check_now", IDS_ABOUT_PAGE_CHECK_NOW },
{ "update_status", IDS_UPGRADE_CHECK_STARTED },
+ { "restart_now", IDS_RESTART_AND_UPDATE },
#else
{ "product", IDS_PRODUCT_NAME },
{ "check_now", IDS_ABOUT_CHROME_UPDATE_CHECK },
@@ -239,6 +241,8 @@ void AboutPageHandler::RegisterMessages() {
#if defined(OS_CHROMEOS)
dom_ui_->RegisterMessageCallback("CheckNow",
NewCallback(this, &AboutPageHandler::CheckNow));
+ dom_ui_->RegisterMessageCallback("RestartNow",
+ NewCallback(this, &AboutPageHandler::RestartNow));
#endif
}
@@ -272,6 +276,10 @@ void AboutPageHandler::CheckNow(const ListValue* args) {
chromeos::InitiateUpdateCheck();
}
+void AboutPageHandler::RestartNow(const ListValue* args) {
+ chromeos::CrosLibrary::Get()->GetPowerLibrary()->RequestRestart();
+}
+
void AboutPageHandler::UpdateStatus(
const chromeos::UpdateLibrary::Status& status) {
string16 message;
@@ -347,6 +355,10 @@ void AboutPageHandler::UpdateStatus(
dom_ui_->CallJavascriptFunction(L"AboutPage.setUpdateImage",
*image_string);
}
+ // We'll change the "Check For Update" button to "Restart" button.
+ if (status.status == chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) {
+ dom_ui_->CallJavascriptFunction(L"AboutPage.changeToRestartButton");
+ }
}
void AboutPageHandler::OnOSVersion(chromeos::VersionLoader::Handle handle,
« no previous file with comments | « chrome/browser/dom_ui/options/about_page_handler.h ('k') | chrome/browser/resources/options/about_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698