OLD | NEW |
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 Loading... |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // needed. | 150 // needed. |
148 ExtensionUninstallDialog* GetExtensionUninstallDialog(); | 151 ExtensionUninstallDialog* GetExtensionUninstallDialog(); |
149 | 152 |
150 // Continuation for installing a bookmark app after favicon lookup. | 153 // Continuation for installing a bookmark app after favicon lookup. |
151 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, | 154 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, |
152 const history::FaviconImageResult& image_result); | 155 const history::FaviconImageResult& image_result); |
153 | 156 |
154 // Sends |highlight_app_id_| to the js. | 157 // Sends |highlight_app_id_| to the js. |
155 void SetAppToBeHighlighted(); | 158 void SetAppToBeHighlighted(); |
156 | 159 |
157 void OnPreferenceChanged(); | 160 void OnExtensionPreferenceChanged(); |
| 161 |
| 162 void OnLocalStatePreferenceChanged(); |
158 | 163 |
159 // The apps are represented in the extensions model, which | 164 // The apps are represented in the extensions model, which |
160 // outlives us since it's owned by our containing profile. | 165 // outlives us since it's owned by our containing profile. |
161 ExtensionService* const extension_service_; | 166 ExtensionService* const extension_service_; |
162 | 167 |
163 // We monitor changes to the extension system so that we can reload the apps | 168 // We monitor changes to the extension system so that we can reload the apps |
164 // when necessary. | 169 // when necessary. |
165 content::NotificationRegistrar registrar_; | 170 content::NotificationRegistrar registrar_; |
166 | 171 |
167 // Monitor extension preference changes so that the Web UI can be notified. | 172 // Monitor extension preference changes so that the Web UI can be notified. |
168 PrefChangeRegistrar pref_change_registrar_; | 173 PrefChangeRegistrar extension_pref_change_registrar_; |
| 174 |
| 175 // Monitor the local state pref to control the app launcher promo. |
| 176 PrefChangeRegistrar local_state_pref_change_registrar_; |
169 | 177 |
170 // Used to show confirmation UI for uninstalling extensions in incognito mode. | 178 // Used to show confirmation UI for uninstalling extensions in incognito mode. |
171 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; | 179 scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_; |
172 | 180 |
173 // Used to show confirmation UI for enabling extensions. | 181 // Used to show confirmation UI for enabling extensions. |
174 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 182 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; |
175 | 183 |
176 // The ids of apps to show on the NTP. | 184 // The ids of apps to show on the NTP. |
177 std::set<std::string> visible_apps_; | 185 std::set<std::string> visible_apps_; |
178 | 186 |
(...skipping 17 matching lines...) Expand all Loading... |
196 // when the app is added to the page (via getAppsCallback or appAdded). | 204 // when the app is added to the page (via getAppsCallback or appAdded). |
197 std::string highlight_app_id_; | 205 std::string highlight_app_id_; |
198 | 206 |
199 // Used for favicon loading tasks. | 207 // Used for favicon loading tasks. |
200 CancelableTaskTracker cancelable_task_tracker_; | 208 CancelableTaskTracker cancelable_task_tracker_; |
201 | 209 |
202 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 210 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
203 }; | 211 }; |
204 | 212 |
205 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 213 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
OLD | NEW |