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" |
11 #include "base/scoped_observer.h" | |
12 #include "content/public/browser/web_ui_message_handler.h" | 11 #include "content/public/browser/web_ui_message_handler.h" |
13 #include "extensions/browser/extension_registry_observer.h" | |
14 | 12 |
15 namespace base { | 13 namespace base { |
16 class ListValue; | 14 class ListValue; |
17 } | 15 } |
18 | 16 |
19 namespace extensions { | 17 namespace extensions { |
20 class ExtensionRegistry; | 18 class ExtensionRegistry; |
Lei Zhang
2015/03/23 23:41:18
no longer needed
Anand Mistry (off Chromium)
2015/03/24 06:15:36
Done.
| |
21 } | 19 } |
22 | 20 |
23 namespace app_list { | 21 namespace app_list { |
24 | 22 |
25 // Handler for the app launcher start page. | 23 // Handler for the app launcher start page. |
26 class StartPageHandler : public content::WebUIMessageHandler, | 24 class StartPageHandler : public content::WebUIMessageHandler { |
27 public extensions::ExtensionRegistryObserver { | |
28 public: | 25 public: |
29 StartPageHandler(); | 26 StartPageHandler(); |
30 ~StartPageHandler() override; | 27 ~StartPageHandler() override; |
31 | 28 |
32 private: | 29 private: |
33 // content::WebUIMessageHandler overrides: | 30 // content::WebUIMessageHandler overrides: |
34 void RegisterMessages() override; | 31 void RegisterMessages() override; |
35 | 32 |
36 // extensions::ExtensionRegistryObserver implementation. | |
37 void OnExtensionLoaded(content::BrowserContext* browser_context, | |
38 const extensions::Extension* extension) override; | |
39 void OnExtensionUnloaded( | |
40 content::BrowserContext* browser_context, | |
41 const extensions::Extension* extension, | |
42 extensions::UnloadedExtensionInfo::Reason reason) override; | |
43 | |
44 #if defined(OS_CHROMEOS) | |
45 // Called when the pref has been changed. | |
46 void OnHotwordEnabledChanged(); | |
47 #endif | |
48 | |
49 // JS callbacks. | 33 // JS callbacks. |
50 void HandleAppListShown(const base::ListValue* args); | 34 void HandleAppListShown(const base::ListValue* args); |
51 void HandleDoodleClicked(const base::ListValue* args); | 35 void HandleDoodleClicked(const base::ListValue* args); |
52 void HandleInitialize(const base::ListValue* args); | 36 void HandleInitialize(const base::ListValue* args); |
53 void HandleLaunchApp(const base::ListValue* args); | 37 void HandleLaunchApp(const base::ListValue* args); |
54 void HandleSpeechResult(const base::ListValue* args); | |
55 void HandleSpeechSoundLevel(const base::ListValue* args); | |
56 void HandleSpeechRecognition(const base::ListValue* args); | |
57 | 38 |
58 PrefChangeRegistrar pref_change_registrar_; | 39 PrefChangeRegistrar pref_change_registrar_; |
59 | 40 |
60 ScopedObserver<extensions::ExtensionRegistry, | |
61 extensions::ExtensionRegistryObserver> | |
62 extension_registry_observer_; | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(StartPageHandler); | 41 DISALLOW_COPY_AND_ASSIGN(StartPageHandler); |
65 }; | 42 }; |
66 | 43 |
67 } // namespace app_list | 44 } // namespace app_list |
68 | 45 |
69 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ | 46 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ |
OLD | NEW |