| 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 <memory> |
| 8 #include <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "apps/metrics_names.h" | 12 #include "apps/metrics_names.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
| 15 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 15 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 16 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" | 16 #include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h" |
| 17 #include "chrome/common/extensions/extension_constants.h" | 17 #include "chrome/common/extensions/extension_constants.h" |
| 18 #include "components/favicon/core/favicon_service.h" | 18 #include "components/favicon/core/favicon_service.h" |
| 19 #include "components/prefs/pref_change_registrar.h" | 19 #include "components/prefs/pref_change_registrar.h" |
| 20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 #include "content/public/browser/web_ui_message_handler.h" | 22 #include "content/public/browser/web_ui_message_handler.h" |
| 23 #include "extensions/browser/extension_registry_observer.h" | 23 #include "extensions/browser/extension_registry_observer.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // ExtensionEnableFlowDelegate: | 163 // ExtensionEnableFlowDelegate: |
| 164 void ExtensionEnableFlowFinished() override; | 164 void ExtensionEnableFlowFinished() override; |
| 165 void ExtensionEnableFlowAborted(bool user_initiated) override; | 165 void ExtensionEnableFlowAborted(bool user_initiated) override; |
| 166 | 166 |
| 167 // Returns the ExtensionUninstallDialog object for this class, creating it if | 167 // Returns the ExtensionUninstallDialog object for this class, creating it if |
| 168 // needed. | 168 // needed. |
| 169 extensions::ExtensionUninstallDialog* GetExtensionUninstallDialog(); | 169 extensions::ExtensionUninstallDialog* GetExtensionUninstallDialog(); |
| 170 | 170 |
| 171 // Continuation for installing a bookmark app after favicon lookup. | 171 // Continuation for installing a bookmark app after favicon lookup. |
| 172 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, | 172 void OnFaviconForApp(std::unique_ptr<AppInstallInfo> install_info, |
| 173 const favicon_base::FaviconImageResult& image_result); | 173 const favicon_base::FaviconImageResult& image_result); |
| 174 | 174 |
| 175 // Sends |highlight_app_id_| to the js. | 175 // Sends |highlight_app_id_| to the js. |
| 176 void SetAppToBeHighlighted(); | 176 void SetAppToBeHighlighted(); |
| 177 | 177 |
| 178 void OnExtensionPreferenceChanged(); | 178 void OnExtensionPreferenceChanged(); |
| 179 | 179 |
| 180 void OnLocalStatePreferenceChanged(); | 180 void OnLocalStatePreferenceChanged(); |
| 181 | 181 |
| 182 // Called when an app is removed (unloaded or uninstalled). Updates the UI. | 182 // Called when an app is removed (unloaded or uninstalled). Updates the UI. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 193 // when necessary. | 193 // when necessary. |
| 194 content::NotificationRegistrar registrar_; | 194 content::NotificationRegistrar registrar_; |
| 195 | 195 |
| 196 // Monitor extension preference changes so that the Web UI can be notified. | 196 // Monitor extension preference changes so that the Web UI can be notified. |
| 197 PrefChangeRegistrar extension_pref_change_registrar_; | 197 PrefChangeRegistrar extension_pref_change_registrar_; |
| 198 | 198 |
| 199 // Monitor the local state pref to control the app launcher promo. | 199 // Monitor the local state pref to control the app launcher promo. |
| 200 PrefChangeRegistrar local_state_pref_change_registrar_; | 200 PrefChangeRegistrar local_state_pref_change_registrar_; |
| 201 | 201 |
| 202 // Used to show confirmation UI for uninstalling extensions in incognito mode. | 202 // Used to show confirmation UI for uninstalling extensions in incognito mode. |
| 203 scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_; | 203 std::unique_ptr<extensions::ExtensionUninstallDialog> |
| 204 extension_uninstall_dialog_; |
| 204 | 205 |
| 205 // Used to show confirmation UI for enabling extensions. | 206 // Used to show confirmation UI for enabling extensions. |
| 206 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 207 std::unique_ptr<ExtensionEnableFlow> extension_enable_flow_; |
| 207 | 208 |
| 208 // The ids of apps to show on the NTP. | 209 // The ids of apps to show on the NTP. |
| 209 std::set<std::string> visible_apps_; | 210 std::set<std::string> visible_apps_; |
| 210 | 211 |
| 211 // The id of the extension we are prompting the user about (either enable or | 212 // The id of the extension we are prompting the user about (either enable or |
| 212 // uninstall). | 213 // uninstall). |
| 213 std::string extension_id_prompting_; | 214 std::string extension_id_prompting_; |
| 214 | 215 |
| 215 // When true, we ignore changes to the underlying data rather than immediately | 216 // When true, we ignore changes to the underlying data rather than immediately |
| 216 // refreshing. This is useful when making many batch updates to avoid flicker. | 217 // refreshing. This is useful when making many batch updates to avoid flicker. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 228 // when the app is added to the page (via getAppsCallback or appAdded). | 229 // when the app is added to the page (via getAppsCallback or appAdded). |
| 229 std::string highlight_app_id_; | 230 std::string highlight_app_id_; |
| 230 | 231 |
| 231 // Used for favicon loading tasks. | 232 // Used for favicon loading tasks. |
| 232 base::CancelableTaskTracker cancelable_task_tracker_; | 233 base::CancelableTaskTracker cancelable_task_tracker_; |
| 233 | 234 |
| 234 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 235 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 235 }; | 236 }; |
| 236 | 237 |
| 237 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 238 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |