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

Side by Side Diff: chrome/browser/ui/webui/app_list/start_page_handler.h

Issue 874563003: Remove old HTML app list start page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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" 11 #include "base/scoped_observer.h"
12 #include "chrome/browser/ui/app_list/recommended_apps_observer.h"
13 #include "content/public/browser/web_ui_message_handler.h" 12 #include "content/public/browser/web_ui_message_handler.h"
14 #include "extensions/browser/extension_registry_observer.h" 13 #include "extensions/browser/extension_registry_observer.h"
15 14
16 namespace base { 15 namespace base {
17 class ListValue; 16 class ListValue;
18 } 17 }
19 18
20 namespace extensions { 19 namespace extensions {
21 class ExtensionRegistry; 20 class ExtensionRegistry;
22 } 21 }
23 22
24 namespace app_list { 23 namespace app_list {
25 24
26 class RecommendedApps;
27
28 // Handler for the app launcher start page. 25 // Handler for the app launcher start page.
29 class StartPageHandler : public content::WebUIMessageHandler, 26 class StartPageHandler : public content::WebUIMessageHandler,
30 public extensions::ExtensionRegistryObserver, 27 public extensions::ExtensionRegistryObserver {
31 public RecommendedAppsObserver {
32 public: 28 public:
33 StartPageHandler(); 29 StartPageHandler();
34 ~StartPageHandler() override; 30 ~StartPageHandler() override;
35 31
36 private: 32 private:
37 // content::WebUIMessageHandler overrides: 33 // content::WebUIMessageHandler overrides:
38 void RegisterMessages() override; 34 void RegisterMessages() override;
39 35
40 // extensions::ExtensionRegistryObserver implementation. 36 // extensions::ExtensionRegistryObserver implementation.
41 void OnExtensionLoaded(content::BrowserContext* browser_context, 37 void OnExtensionLoaded(content::BrowserContext* browser_context,
42 const extensions::Extension* extension) override; 38 const extensions::Extension* extension) override;
43 void OnExtensionUnloaded( 39 void OnExtensionUnloaded(
44 content::BrowserContext* browser_context, 40 content::BrowserContext* browser_context,
45 const extensions::Extension* extension, 41 const extensions::Extension* extension,
46 extensions::UnloadedExtensionInfo::Reason reason) override; 42 extensions::UnloadedExtensionInfo::Reason reason) override;
47 43
48 // RecommendedAppsObserver overrdies:
49 void OnRecommendedAppsChanged() override;
50
51 // Creates a ListValue for the recommended apps and sends it to js side.
52 void SendRecommendedApps();
53
54 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
55 // Called when the pref has been changed. 45 // Called when the pref has been changed.
56 void OnHotwordEnabledChanged(); 46 void OnHotwordEnabledChanged();
57 #endif 47 #endif
58 48
59 // JS callbacks. 49 // JS callbacks.
60 void HandleInitialize(const base::ListValue* args); 50 void HandleInitialize(const base::ListValue* args);
61 void HandleLaunchApp(const base::ListValue* args); 51 void HandleLaunchApp(const base::ListValue* args);
62 void HandleSpeechResult(const base::ListValue* args); 52 void HandleSpeechResult(const base::ListValue* args);
63 void HandleSpeechSoundLevel(const base::ListValue* args); 53 void HandleSpeechSoundLevel(const base::ListValue* args);
64 void HandleSpeechRecognition(const base::ListValue* args); 54 void HandleSpeechRecognition(const base::ListValue* args);
65 55
66 RecommendedApps* recommended_apps_; // Not owned.
67 PrefChangeRegistrar pref_change_registrar_; 56 PrefChangeRegistrar pref_change_registrar_;
68 57
69 ScopedObserver<extensions::ExtensionRegistry, 58 ScopedObserver<extensions::ExtensionRegistry,
70 extensions::ExtensionRegistryObserver> 59 extensions::ExtensionRegistryObserver>
71 extension_registry_observer_; 60 extension_registry_observer_;
72 61
73 DISALLOW_COPY_AND_ASSIGN(StartPageHandler); 62 DISALLOW_COPY_AND_ASSIGN(StartPageHandler);
74 }; 63 };
75 64
76 } // namespace app_list 65 } // namespace app_list
77 66
78 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_ 67 #endif // CHROME_BROWSER_UI_WEBUI_APP_LIST_START_PAGE_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/app_list/start_page_browsertest.js ('k') | chrome/browser/ui/webui/app_list/start_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698