| 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 30 matching lines...) Expand all Loading... |
| 41 explicit AppLauncherHandler(ExtensionService* extension_service); | 41 explicit AppLauncherHandler(ExtensionService* extension_service); |
| 42 virtual ~AppLauncherHandler(); | 42 virtual ~AppLauncherHandler(); |
| 43 | 43 |
| 44 // Populate a dictionary with the information from an extension. | 44 // Populate a dictionary with the information from an extension. |
| 45 static void CreateAppInfo( | 45 static void CreateAppInfo( |
| 46 const extensions::Extension* extension, | 46 const extensions::Extension* extension, |
| 47 ExtensionService* service, | 47 ExtensionService* service, |
| 48 base::DictionaryValue* value); | 48 base::DictionaryValue* value); |
| 49 | 49 |
| 50 // WebUIMessageHandler implementation. | 50 // WebUIMessageHandler implementation. |
| 51 virtual void RegisterMessages() OVERRIDE; | 51 virtual void RegisterMessages() override; |
| 52 | 52 |
| 53 // content::NotificationObserver | 53 // content::NotificationObserver |
| 54 virtual void Observe(int type, | 54 virtual void Observe(int type, |
| 55 const content::NotificationSource& source, | 55 const content::NotificationSource& source, |
| 56 const content::NotificationDetails& details) OVERRIDE; | 56 const content::NotificationDetails& details) override; |
| 57 | 57 |
| 58 // Populate the given dictionary with all installed app info. | 58 // Populate the given dictionary with all installed app info. |
| 59 void FillAppDictionary(base::DictionaryValue* value); | 59 void FillAppDictionary(base::DictionaryValue* value); |
| 60 | 60 |
| 61 // Create a dictionary value for the given extension. May return NULL, e.g. if | 61 // Create a dictionary value for the given extension. May return NULL, e.g. if |
| 62 // the given extension is not an app. If non-NULL, the caller assumes | 62 // the given extension is not an app. If non-NULL, the caller assumes |
| 63 // ownership of the pointer. | 63 // ownership of the pointer. |
| 64 base::DictionaryValue* GetAppInfo(const extensions::Extension* extension); | 64 base::DictionaryValue* GetAppInfo(const extensions::Extension* extension); |
| 65 | 65 |
| 66 // Populate the given dictionary with the web store promo content. | 66 // Populate the given dictionary with the web store promo content. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 syncer::StringOrdinal page_ordinal; | 117 syncer::StringOrdinal page_ordinal; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Reset some instance flags we use to track the currently uninstalling app. | 120 // Reset some instance flags we use to track the currently uninstalling app. |
| 121 void CleanupAfterUninstall(); | 121 void CleanupAfterUninstall(); |
| 122 | 122 |
| 123 // Prompts the user to re-enable the app for |extension_id|. | 123 // Prompts the user to re-enable the app for |extension_id|. |
| 124 void PromptToEnableApp(const std::string& extension_id); | 124 void PromptToEnableApp(const std::string& extension_id); |
| 125 | 125 |
| 126 // ExtensionUninstallDialog::Delegate: | 126 // ExtensionUninstallDialog::Delegate: |
| 127 virtual void ExtensionUninstallAccepted() OVERRIDE; | 127 virtual void ExtensionUninstallAccepted() override; |
| 128 virtual void ExtensionUninstallCanceled() OVERRIDE; | 128 virtual void ExtensionUninstallCanceled() override; |
| 129 | 129 |
| 130 // ExtensionEnableFlowDelegate: | 130 // ExtensionEnableFlowDelegate: |
| 131 virtual void ExtensionEnableFlowFinished() OVERRIDE; | 131 virtual void ExtensionEnableFlowFinished() override; |
| 132 virtual void ExtensionEnableFlowAborted(bool user_initiated) OVERRIDE; | 132 virtual void ExtensionEnableFlowAborted(bool user_initiated) override; |
| 133 | 133 |
| 134 // Returns the ExtensionUninstallDialog object for this class, creating it if | 134 // Returns the ExtensionUninstallDialog object for this class, creating it if |
| 135 // needed. | 135 // needed. |
| 136 extensions::ExtensionUninstallDialog* GetExtensionUninstallDialog(); | 136 extensions::ExtensionUninstallDialog* GetExtensionUninstallDialog(); |
| 137 | 137 |
| 138 // Continuation for installing a bookmark app after favicon lookup. | 138 // Continuation for installing a bookmark app after favicon lookup. |
| 139 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, | 139 void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info, |
| 140 const favicon_base::FaviconImageResult& image_result); | 140 const favicon_base::FaviconImageResult& image_result); |
| 141 | 141 |
| 142 // Sends |highlight_app_id_| to the js. | 142 // Sends |highlight_app_id_| to the js. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // when the app is added to the page (via getAppsCallback or appAdded). | 189 // when the app is added to the page (via getAppsCallback or appAdded). |
| 190 std::string highlight_app_id_; | 190 std::string highlight_app_id_; |
| 191 | 191 |
| 192 // Used for favicon loading tasks. | 192 // Used for favicon loading tasks. |
| 193 base::CancelableTaskTracker cancelable_task_tracker_; | 193 base::CancelableTaskTracker cancelable_task_tracker_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); | 195 DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ | 198 #endif // CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_ |
| OLD | NEW |