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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.h

Issue 1757673002: NTP4/apps page: fix page stickiness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-promo-cpp
Patch Set: todookie Created 4 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_NTP_APP_LAUNCHER_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 class ExtensionEnableFlow; 27 class ExtensionEnableFlow;
28 class ExtensionService; 28 class ExtensionService;
29 class PrefChangeRegistrar; 29 class PrefChangeRegistrar;
30 class Profile; 30 class Profile;
31 31
32 namespace favicon_base { 32 namespace favicon_base {
33 struct FaviconImageResult; 33 struct FaviconImageResult;
34 } 34 }
35 35
36 namespace user_prefs {
37 class PrefRegistrySyncable;
38 }
39
36 // The handler for Javascript messages related to the "apps" view. 40 // The handler for Javascript messages related to the "apps" view.
37 class AppLauncherHandler 41 class AppLauncherHandler
38 : public content::WebUIMessageHandler, 42 : public content::WebUIMessageHandler,
39 public extensions::ExtensionUninstallDialog::Delegate, 43 public extensions::ExtensionUninstallDialog::Delegate,
40 public ExtensionEnableFlowDelegate, 44 public ExtensionEnableFlowDelegate,
41 public content::NotificationObserver, 45 public content::NotificationObserver,
42 public extensions::ExtensionRegistryObserver { 46 public extensions::ExtensionRegistryObserver {
43 public: 47 public:
44 explicit AppLauncherHandler(ExtensionService* extension_service); 48 explicit AppLauncherHandler(ExtensionService* extension_service);
45 ~AppLauncherHandler() override; 49 ~AppLauncherHandler() override;
46 50
47 // Populate a dictionary with the information from an extension. 51 // Populate a dictionary with the information from an extension.
48 static void CreateAppInfo( 52 static void CreateAppInfo(
49 const extensions::Extension* extension, 53 const extensions::Extension* extension,
50 ExtensionService* service, 54 ExtensionService* service,
51 base::DictionaryValue* value); 55 base::DictionaryValue* value);
52 56
57 // Registers values (strings etc.) for the page.
58 static void GetLocalizedValues(Profile* profile,
59 base::DictionaryValue* values);
60
61 // Register per-profile preferences.
62 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
63
53 // WebUIMessageHandler: 64 // WebUIMessageHandler:
54 void RegisterMessages() override; 65 void RegisterMessages() override;
55 66
56 // content::NotificationObserver: 67 // content::NotificationObserver:
57 void Observe(int type, 68 void Observe(int type,
58 const content::NotificationSource& source, 69 const content::NotificationSource& source,
59 const content::NotificationDetails& details) override; 70 const content::NotificationDetails& details) override;
60 71
61 // extensions::ExtensionRegistryObserver: 72 // extensions::ExtensionRegistryObserver:
62 void OnExtensionLoaded(content::BrowserContext* browser_context, 73 void OnExtensionLoaded(content::BrowserContext* browser_context,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void HandleSetPageIndex(const base::ListValue* args); 124 void HandleSetPageIndex(const base::ListValue* args);
114 125
115 // Handles "saveAppPageName" message with |args| containing [name, 126 // Handles "saveAppPageName" message with |args| containing [name,
116 // page_index]. 127 // page_index].
117 void HandleSaveAppPageName(const base::ListValue* args); 128 void HandleSaveAppPageName(const base::ListValue* args);
118 129
119 // Handles "generateAppForLink" message with |args| containing [url, title, 130 // Handles "generateAppForLink" message with |args| containing [url, title,
120 // page_index]. 131 // page_index].
121 void HandleGenerateAppForLink(const base::ListValue* args); 132 void HandleGenerateAppForLink(const base::ListValue* args);
122 133
123 // Other registered message callbacks with unused |args|. 134 // Handles "stopShowingAppLauncherPromo" message with unused |args|.
124 void StopShowingAppLauncherPromo(const base::ListValue* args); 135 void HandleStopShowingAppLauncherPromo(const base::ListValue* args);
125 void OnLearnMore(const base::ListValue* args); 136
137 // Handles "learnMore" message with unused |args|.
138 void HandleOnLearnMore(const base::ListValue* args);
139
140 // Handles "pageSelected" message with |args| containing [page_index].
141 void HandlePageSelected(const base::ListValue* args);
126 142
127 private: 143 private:
128 struct AppInstallInfo { 144 struct AppInstallInfo {
129 AppInstallInfo(); 145 AppInstallInfo();
130 ~AppInstallInfo(); 146 ~AppInstallInfo();
131 147
132 base::string16 title; 148 base::string16 title;
133 GURL app_url; 149 GURL app_url;
134 syncer::StringOrdinal page_ordinal; 150 syncer::StringOrdinal page_ordinal;
135 }; 151 };
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // when the app is added to the page (via getAppsCallback or appAdded). 228 // when the app is added to the page (via getAppsCallback or appAdded).
213 std::string highlight_app_id_; 229 std::string highlight_app_id_;
214 230
215 // Used for favicon loading tasks. 231 // Used for favicon loading tasks.
216 base::CancelableTaskTracker cancelable_task_tracker_; 232 base::CancelableTaskTracker cancelable_task_tracker_;
217 233
218 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); 234 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler);
219 }; 235 };
220 236
221 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ 237 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/page_list_view.js ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698