Chromium Code Reviews| 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..84de0e1a5811d0ae3bf66c9459839b5dff6459a3 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_; |
| + // Whether to start listening to upgrade detector. |
|
sky
2017/06/08 18:09:52
How about: If true changes to UpgradeObserver are
weidongg
2017/06/08 18:58:07
Yes, that's better, thanks. Done.
|
| + bool enable_upgrade_observer_; |
| + |
| // Used for callbacks. |
| base::WeakPtrFactory<HelpHandler> weak_factory_; |