Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / app_list / start_page_handler.h
index c3d35bb..1ebff18 100644 (file)
@@ -7,7 +7,10 @@
 
 #include "base/basictypes.h"
 #include "base/compiler_specific.h"
+#include "base/prefs/pref_change_registrar.h"
 #include "chrome/browser/ui/app_list/recommended_apps_observer.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/web_ui_message_handler.h"
 
 namespace base {
@@ -20,6 +23,7 @@ class RecommendedApps;
 
 // Handler for the app launcher start page.
 class StartPageHandler : public content::WebUIMessageHandler,
+                         public content::NotificationObserver,
                          public RecommendedAppsObserver {
  public:
   StartPageHandler();
@@ -29,12 +33,22 @@ class StartPageHandler : public content::WebUIMessageHandler,
   // content::WebUIMessageHandler overrides:
   virtual void RegisterMessages() OVERRIDE;
 
+  // Overridden from content::NotificationObserver:
+  virtual void Observe(int type,
+                       const content::NotificationSource& source,
+                       const content::NotificationDetails& details) OVERRIDE;
+
   // RecommendedAppsObserver overrdies:
   virtual void OnRecommendedAppsChanged() OVERRIDE;
 
   // Creates a ListValue for the recommended apps and sends it to js side.
   void SendRecommendedApps();
 
+#if defined(OS_CHROMEOS)
+  // Called when the pref has been changed.
+  void OnHotwordEnabledChanged();
+#endif
+
   // JS callbacks.
   void HandleInitialize(const base::ListValue* args);
   void HandleLaunchApp(const base::ListValue* args);
@@ -43,6 +57,8 @@ class StartPageHandler : public content::WebUIMessageHandler,
   void HandleSpeechRecognition(const base::ListValue* args);
 
   RecommendedApps* recommended_apps_;  // Not owned.
+  PrefChangeRegistrar pref_change_registrar_;
+  content::NotificationRegistrar registrar_;
 
   DISALLOW_COPY_AND_ASSIGN(StartPageHandler);
 };