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

Unified Diff: chrome/browser/ui/webui/help/version_updater_chromeos.h

Issue 578293002: Fixed channel switch when user decides to switch to another channel in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix. Created 6 years, 3 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/ui/webui/help/version_updater_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/help/version_updater_chromeos.h
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.h b/chrome/browser/ui/webui/help/version_updater_chromeos.h
index bfdee79df091d2ee082631bfd251bbf22c2a8099..ae4b9dfa87b5fd5ff129e91dd0befbac550e7552 100644
--- a/chrome/browser/ui/webui/help/version_updater_chromeos.h
+++ b/chrome/browser/ui/webui/help/version_updater_chromeos.h
@@ -24,6 +24,10 @@ class VersionUpdaterCros : public VersionUpdater,
// Gets the last update status, without triggering a new check or download.
void GetUpdateStatus(const StatusCallback& callback);
+ void set_can_update_for_testing(bool can_update_for_testing) {
+ can_update_for_testing_ = can_update_for_testing;
+ }
+
protected:
friend class VersionUpdater;
@@ -39,12 +43,23 @@ class VersionUpdaterCros : public VersionUpdater,
// Callback from UpdateEngineClient::RequestUpdateCheck().
void OnUpdateCheck(chromeos::UpdateEngineClient::UpdateCheckResult result);
+ // Returns whether an update is allowed. If not, it calls the callback with
+ // the appropriate status.
+ bool EnsureCanUpdate(const StatusCallback& callback);
+
// Callback used to communicate update status to the client.
StatusCallback callback_;
// Last state received via UpdateStatusChanged().
chromeos::UpdateEngineClient::UpdateStatusOperation last_operation_;
+ // True if an update check should be scheduled when the update engine will
James Hawkins 2014/09/22 16:48:31 Optional nit: This is easier to grok for me if you
ygorshenin1 2014/09/22 19:01:54 Done.
+ // be idle.
+ bool check_for_update_when_idle_;
+
+ // True if an update check can be performed in tests.
+ bool can_update_for_testing_;
James Hawkins 2014/09/22 16:48:31 I took a high-level look at what you're trying to
ygorshenin1 2014/09/22 19:01:54 I've made a virtual EnsureCanUpdate() method and o
+
base::WeakPtrFactory<VersionUpdaterCros> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(VersionUpdaterCros);
« no previous file with comments | « no previous file | chrome/browser/ui/webui/help/version_updater_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698