diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 00:49:48 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 00:49:48 +0000 |
commit | 85eafad475486d80d3087f09060deb95bd23e7c9 (patch) | |
tree | 2038f90feb32a2873207d3bc87de9f95911c7a4c | |
parent | eb118469dc357d8b4b1a5becaa77ae92d9846cec (diff) | |
download | chromium_src-85eafad475486d80d3087f09060deb95bd23e7c9.zip chromium_src-85eafad475486d80d3087f09060deb95bd23e7c9.tar.gz chromium_src-85eafad475486d80d3087f09060deb95bd23e7c9.tar.bz2 |
Help: Show the version update section even for Chromium OS.
BUG=chromiumos:27262
TEST=none
R=csilv,dbeam
Review URL: https://chromiumcodereview.appspot.com/9615029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125268 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 23 insertions, 9 deletions
diff --git a/chrome/browser/chromeos/dbus/update_engine_client.cc b/chrome/browser/chromeos/dbus/update_engine_client.cc index 9352375..d879235 100644 --- a/chrome/browser/chromeos/dbus/update_engine_client.cc +++ b/chrome/browser/chromeos/dbus/update_engine_client.cc @@ -256,7 +256,7 @@ class UpdateEngineClientStubImpl : public UpdateEngineClient { virtual bool HasObserver(Observer* observer) OVERRIDE { return false; } virtual void RequestUpdateCheck(UpdateCheckCallback callback) OVERRIDE { - callback.Run(UPDATE_RESULT_FAILED); + callback.Run(UPDATE_RESULT_NOTIMPLEMENTED); } virtual void RebootAfterUpdate() OVERRIDE {} virtual void SetReleaseTrack(const std::string& track) OVERRIDE {} diff --git a/chrome/browser/chromeos/dbus/update_engine_client.h b/chrome/browser/chromeos/dbus/update_engine_client.h index 52d5d20..dc84714 100644 --- a/chrome/browser/chromeos/dbus/update_engine_client.h +++ b/chrome/browser/chromeos/dbus/update_engine_client.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -57,6 +57,7 @@ class UpdateEngineClient { enum UpdateCheckResult { UPDATE_RESULT_SUCCESS, UPDATE_RESULT_FAILED, + UPDATE_RESULT_NOTIMPLEMENTED, }; // Interface for observing changes from the update engine. diff --git a/chrome/browser/resources/help/help.html b/chrome/browser/resources/help/help.html index 54c9e84..c288edb 100644 --- a/chrome/browser/resources/help/help.html +++ b/chrome/browser/resources/help/help.html @@ -49,7 +49,7 @@ <button id="more-info" class="link-button" i18n-content="moreInfoLink"> </button> </if> -<if expr="pp_ifdef('_google_chrome') and (is_win or is_macosx or pp_ifdef('chromeos'))"> +<if expr="pp_ifdef('chromeos') or (pp_ifdef('_google_chrome') and (is_win or is_macosx))"> <div id="update-status-container"> <div id="update-status-icon" class="up-to-date"></div> <span id="update-status" i18n-content="updateCheckStarted"></span> diff --git a/chrome/browser/ui/webui/help/version_updater.h b/chrome/browser/ui/webui/help/version_updater.h index 1db93ee..ccfde3f 100644 --- a/chrome/browser/ui/webui/help/version_updater.h +++ b/chrome/browser/ui/webui/help/version_updater.h @@ -14,10 +14,6 @@ // Interface implemented to expose per-platform updating functionality. class VersionUpdater { public: -#if defined(OS_CHROMEOS) - typedef base::Callback<void(const std::string&)> ChannelCallback; -#endif - // Update process state machine. enum Status { CHECKING, @@ -37,6 +33,12 @@ class VersionUpdater { }; #endif // defined(OS_MACOSX) + // TODO(jhawkins): Use a delegate interface instead of multiple callback + // types. +#if defined(OS_CHROMEOS) + typedef base::Callback<void(const std::string&)> ChannelCallback; +#endif + // Used to update the client of status changes. int parameter is the progress // and should only be non-zero for the UPDATING state. string16 parameter is // a message explaining a failure. diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chrome/browser/ui/webui/help/version_updater_chromeos.cc index 850dd03..dacc955 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.cc @@ -34,7 +34,7 @@ void VersionUpdaterCros::CheckForUpdate(const StatusCallback& callback) { if (!WizardController::default_controller() || WizardController::IsDeviceRegistered()) { update_engine_client->RequestUpdateCheck( - UpdateEngineClient::EmptyUpdateCheckCallback()); + base::Bind(&VersionUpdaterCros::OnUpdateCheck, base::Unretained(this))); } } @@ -99,7 +99,14 @@ void VersionUpdaterCros::UpdateStatusChanged( callback_.Run(my_status, progress, string16()); } -// Callback from UpdateEngine with channel information. +void VersionUpdaterCros::OnUpdateCheck( + UpdateEngineClient::UpdateCheckResult result) { + // If version updating is not implemented, this binary is the most up-to-date + // possible with respect to automatic updating. + if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED) + callback_.Run(UPDATED, 0, string16()); +} + void VersionUpdaterCros::UpdateSelectedChannel(const std::string& channel) { channel_callback_.Run(channel); } diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.h b/chrome/browser/ui/webui/help/version_updater_chromeos.h index 7036689..39cc307 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.h +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.h @@ -31,6 +31,10 @@ class VersionUpdaterCros : public VersionUpdater, virtual void UpdateStatusChanged( const chromeos::UpdateEngineClient::Status& status) OVERRIDE; + // Callback from UpdateEngineClient::RequestUpdateCheck(). + void OnUpdateCheck(chromeos::UpdateEngineClient::UpdateCheckResult result); + + // Callback from UpdateEngineClient::GetReleaseTrack(). void UpdateSelectedChannel(const std::string& channel); // Callback used to communicate update status to the client. |