OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace app_list { | 24 namespace app_list { |
25 | 25 |
26 class RecommendedApps; | 26 class RecommendedApps; |
27 | 27 |
28 // Handler for the app launcher start page. | 28 // Handler for the app launcher start page. |
29 class StartPageHandler : public content::WebUIMessageHandler, | 29 class StartPageHandler : public content::WebUIMessageHandler, |
30 public extensions::ExtensionRegistryObserver, | 30 public extensions::ExtensionRegistryObserver, |
31 public RecommendedAppsObserver { | 31 public RecommendedAppsObserver { |
32 public: | 32 public: |
33 StartPageHandler(); | 33 StartPageHandler(); |
34 virtual ~StartPageHandler(); | 34 ~StartPageHandler() override; |
35 | 35 |
36 private: | 36 private: |
37 // content::WebUIMessageHandler overrides: | 37 // content::WebUIMessageHandler overrides: |
38 virtual void RegisterMessages() override; | 38 void RegisterMessages() override; |
39 | 39 |
40 // extensions::ExtensionRegistryObserver implementation. | 40 // extensions::ExtensionRegistryObserver implementation. |
41 virtual void OnExtensionLoaded( | 41 void OnExtensionLoaded(content::BrowserContext* browser_context, |
42 content::BrowserContext* browser_context, | 42 const extensions::Extension* extension) override; |
43 const extensions::Extension* extension) override; | 43 void OnExtensionUnloaded( |
44 virtual void OnExtensionUnloaded( | |
45 content::BrowserContext* browser_context, | 44 content::BrowserContext* browser_context, |
46 const extensions::Extension* extension, | 45 const extensions::Extension* extension, |
47 extensions::UnloadedExtensionInfo::Reason reason) override; | 46 extensions::UnloadedExtensionInfo::Reason reason) override; |
48 | 47 |
49 // RecommendedAppsObserver overrdies: | 48 // RecommendedAppsObserver overrdies: |
50 virtual void OnRecommendedAppsChanged() override; | 49 void OnRecommendedAppsChanged() override; |
51 | 50 |
52 // Creates a ListValue for the recommended apps and sends it to js side. | 51 // Creates a ListValue for the recommended apps and sends it to js side. |
53 void SendRecommendedApps(); | 52 void SendRecommendedApps(); |
54 | 53 |
55 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
56 // Called when the pref has been changed. | 55 // Called when the pref has been changed. |
57 void OnHotwordEnabledChanged(); | 56 void OnHotwordEnabledChanged(); |
58 #endif | 57 #endif |
59 | 58 |
60 // JS callbacks. | 59 // JS callbacks. |
61 void HandleInitialize(const base::ListValue* args); | 60 void HandleInitialize(const base::ListValue* args); |
62 void HandleLaunchApp(const base::ListValue* args); | 61 void HandleLaunchApp(const base::ListValue* args); |
63 void HandleSpeechResult(const base::ListValue* args); | 62 void HandleSpeechResult(const base::ListValue* args); |
64 void HandleSpeechSoundLevel(const base::ListValue* args); | 63 void HandleSpeechSoundLevel(const base::ListValue* args); |
65 void HandleSpeechRecognition(const base::ListValue* args); | 64 void HandleSpeechRecognition(const base::ListValue* args); |
66 | 65 |
67 RecommendedApps* recommended_apps_; // Not owned. | 66 RecommendedApps* recommended_apps_; // Not owned. |
68 PrefChangeRegistrar pref_change_registrar_; | 67 PrefChangeRegistrar pref_change_registrar_; |
69 | 68 |
70 ScopedObserver<extensions::ExtensionRegistry, | 69 ScopedObserver<extensions::ExtensionRegistry, |
71 extensions::ExtensionRegistryObserver> | 70 extensions::ExtensionRegistryObserver> |
72 extension_registry_observer_; | 71 extension_registry_observer_; |
73 | 72 |
74 DISALLOW_COPY_AND_ASSIGN(StartPageHandler); | 73 DISALLOW_COPY_AND_ASSIGN(StartPageHandler); |
75 }; | 74 }; |
76 | 75 |
77 } // namespace app_list | 76 } // namespace app_list |
78 | 77 |
79 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ | 78 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ |
OLD | NEW |