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

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

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN Created 3 years, 6 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/ui/views/toolbar/toolbar_view.cc ('k') | chrome/browser/ui/webui/help/help_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/help/help_handler.h
diff --git a/chrome/browser/ui/webui/help/help_handler.h b/chrome/browser/ui/webui/help/help_handler.h
index 82b088bb8a06db762d4d519807ded3b7d5c13c77..5aea40c2f0c98baf57918f59c507d4194cd509fa 100644
--- a/chrome/browser/ui/webui/help/help_handler.h
+++ b/chrome/browser/ui/webui/help/help_handler.h
@@ -13,9 +13,8 @@
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "chrome/browser/ui/webui/help/version_updater.h"
+#include "chrome/browser/upgrade_observer.h"
#include "components/policy/core/common/policy_service.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_ui_message_handler.h"
#if defined(OS_CHROMEOS)
@@ -32,7 +31,7 @@ class ListValue;
// WebUI message handler for the help page.
class HelpHandler : public content::WebUIMessageHandler,
- public content::NotificationObserver {
+ public UpgradeObserver {
public:
HelpHandler();
~HelpHandler() override;
@@ -43,10 +42,8 @@ class HelpHandler : public content::WebUIMessageHandler,
// Adds string values for the UI to |localized_strings|.
static void GetLocalizedValues(base::DictionaryValue* localized_strings);
- // NotificationObserver implementation.
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ // UpgradeObserver implementation.
+ void OnUpgradeRecommended() override;
// Returns the browser version as a string.
static base::string16 BuildBrowserVersionString();
@@ -124,12 +121,12 @@ class HelpHandler : public content::WebUIMessageHandler,
// Specialized instance of the VersionUpdater used to update the browser.
std::unique_ptr<VersionUpdater> version_updater_;
- // Used to observe notifications.
- content::NotificationRegistrar registrar_;
-
// Used to observe changes in the |kDeviceAutoUpdateDisabled| policy.
policy::PolicyChangeRegistrar policy_registrar_;
+ // If true changes to UpgradeObserver are applied, if false they are ignored.
+ bool apply_changes_from_upgrade_observer_;
+
// Used for callbacks.
base::WeakPtrFactory<HelpHandler> weak_factory_;
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.cc ('k') | chrome/browser/ui/webui/help/help_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698