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

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

Issue 12985002: Add a new App launcher promo to the apps page / NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OWNERS review round 4. Created 7 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 | Annotate | Revision Log
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void HandleSaveAppPageName(const base::ListValue* args); 86 void HandleSaveAppPageName(const base::ListValue* args);
87 87
88 // Callback for the "generateAppForLink" message. 88 // Callback for the "generateAppForLink" message.
89 void HandleGenerateAppForLink(const base::ListValue* args); 89 void HandleGenerateAppForLink(const base::ListValue* args);
90 90
91 // Callback for the "recordAppLaunchByURL" message. Takes an escaped URL and a 91 // Callback for the "recordAppLaunchByURL" message. Takes an escaped URL and a
92 // launch source (integer), and if the URL represents an app, records the 92 // launch source (integer), and if the URL represents an app, records the
93 // action for UMA. 93 // action for UMA.
94 void HandleRecordAppLaunchByUrl(const base::ListValue* args); 94 void HandleRecordAppLaunchByUrl(const base::ListValue* args);
95 95
96 // Callback for "stopShowingAppLauncherPromo" message.
97 void StopShowingAppLauncherPromo(const base::ListValue* args);
98
96 // Callback for "closeNotification" message. 99 // Callback for "closeNotification" message.
97 void HandleNotificationClose(const base::ListValue* args); 100 void HandleNotificationClose(const base::ListValue* args);
98 101
99 // Callback for "setNotificationsDisabled" message. 102 // Callback for "setNotificationsDisabled" message.
100 void HandleSetNotificationsDisabled(const base::ListValue* args); 103 void HandleSetNotificationsDisabled(const base::ListValue* args);
101 104
102 // Register app launcher preferences. 105 // Register app launcher preferences.
103 static void RegisterUserPrefs(PrefRegistrySyncable* registry); 106 static void RegisterUserPrefs(PrefRegistrySyncable* registry);
104 107
105 // Records the given type of app launch for UMA. 108 // Records the given type of app launch for UMA.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // needed. 147 // needed.
145 ExtensionUninstallDialog* GetExtensionUninstallDialog(); 148 ExtensionUninstallDialog* GetExtensionUninstallDialog();
146 149
147 // Continuation for installing a bookmark app after favicon lookup. 150 // Continuation for installing a bookmark app after favicon lookup.
148 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, 151 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info,
149 const history::FaviconImageResult& image_result); 152 const history::FaviconImageResult& image_result);
150 153
151 // Sends |highlight_app_id_| to the js. 154 // Sends |highlight_app_id_| to the js.
152 void SetAppToBeHighlighted(); 155 void SetAppToBeHighlighted();
153 156
154 void OnPreferenceChanged(); 157 void OnExtensionPreferenceChanged();
158
159 void OnLocalStatePreferenceChanged();
155 160
156 // The apps are represented in the extensions model, which 161 // The apps are represented in the extensions model, which
157 // outlives us since it's owned by our containing profile. 162 // outlives us since it's owned by our containing profile.
158 ExtensionService* const extension_service_; 163 ExtensionService* const extension_service_;
159 164
160 // We monitor changes to the extension system so that we can reload the apps 165 // We monitor changes to the extension system so that we can reload the apps
161 // when necessary. 166 // when necessary.
162 content::NotificationRegistrar registrar_; 167 content::NotificationRegistrar registrar_;
163 168
164 // Monitor extension preference changes so that the Web UI can be notified. 169 // Monitor extension preference changes so that the Web UI can be notified.
165 PrefChangeRegistrar pref_change_registrar_; 170 PrefChangeRegistrar extension_pref_change_registrar_;
171
172 // Monitor the local state pref to control the app launcher promo.
173 PrefChangeRegistrar local_state_pref_change_registrar_;
166 174
167 // Used to show confirmation UI for uninstalling extensions in incognito mode. 175 // Used to show confirmation UI for uninstalling extensions in incognito mode.
168 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; 176 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_;
169 177
170 // Used to show confirmation UI for enabling extensions. 178 // Used to show confirmation UI for enabling extensions.
171 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; 179 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_;
172 180
173 // The ids of apps to show on the NTP. 181 // The ids of apps to show on the NTP.
174 std::set<std::string> visible_apps_; 182 std::set<std::string> visible_apps_;
175 183
(...skipping 17 matching lines...) Expand all
193 // when the app is added to the page (via getAppsCallback or appAdded). 201 // when the app is added to the page (via getAppsCallback or appAdded).
194 std::string highlight_app_id_; 202 std::string highlight_app_id_;
195 203
196 // Used for favicon loading tasks. 204 // Used for favicon loading tasks.
197 CancelableTaskTracker cancelable_task_tracker_; 205 CancelableTaskTracker cancelable_task_tracker_;
198 206
199 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); 207 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler);
200 }; 208 };
201 209
202 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ 210 #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