| 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_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 const Extension* extension, | 167 const Extension* extension, |
| 168 const ExtensionPermissionSet* permissions); | 168 const ExtensionPermissionSet* permissions); |
| 169 | 169 |
| 170 // Installation was successful. This is declared virtual for testing. | 170 // Installation was successful. This is declared virtual for testing. |
| 171 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon); | 171 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon); |
| 172 | 172 |
| 173 // Installation failed. This is declared virtual for testing. | 173 // Installation failed. This is declared virtual for testing. |
| 174 virtual void OnInstallFailure(const string16& error); | 174 virtual void OnInstallFailure(const string16& error); |
| 175 | 175 |
| 176 // ImageLoadingTracker::Observer: | 176 // ImageLoadingTracker::Observer: |
| 177 virtual void OnImageLoaded( | 177 virtual void OnImageLoaded(const gfx::Image& image, |
| 178 SkBitmap* image, const ExtensionResource& resource, int index) OVERRIDE; | 178 const std::string& extension_id, |
| 179 int index) OVERRIDE; |
| 179 | 180 |
| 180 // Opens a new tab page and animates the app icon for the app with id | 181 // Opens a new tab page and animates the app icon for the app with id |
| 181 // |app_id|. | 182 // |app_id|. |
| 182 static void OpenAppInstalledNTP(Browser* browser, const std::string& app_id); | 183 static void OpenAppInstalledNTP(Browser* browser, const std::string& app_id); |
| 183 | 184 |
| 184 protected: | 185 protected: |
| 185 friend class ExtensionWebstorePrivateApiTest; | 186 friend class ExtensionWebstorePrivateApiTest; |
| 186 friend class WebstoreInlineInstallUnpackFailureTest; | 187 friend class WebstoreInlineInstallUnpackFailureTest; |
| 187 | 188 |
| 188 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only | 189 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only |
| 189 // in tests. | 190 // in tests. |
| 190 static void DisableFailureUIForTests(); | 191 static void DisableFailureUIForTests(); |
| 191 | 192 |
| 192 private: | 193 private: |
| 193 friend class GalleryInstallApiTestObserver; | 194 friend class GalleryInstallApiTestObserver; |
| 194 | 195 |
| 195 // Show an infobar for a newly-installed theme. previous_theme_id | 196 // Show an infobar for a newly-installed theme. previous_theme_id |
| 196 // should be empty if the previous theme was the system/default | 197 // should be empty if the previous theme was the system/default |
| 197 // theme. | 198 // theme. |
| 198 static void ShowThemeInfoBar( | 199 static void ShowThemeInfoBar( |
| 199 const std::string& previous_theme_id, bool previous_using_native_theme, | 200 const std::string& previous_theme_id, bool previous_using_native_theme, |
| 200 const Extension* new_theme, Profile* profile); | 201 const Extension* new_theme, Profile* profile); |
| 201 | 202 |
| 202 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains | 203 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains |
| 203 // an empty bitmap, then a default icon will be used instead. | 204 // an empty bitmap, then a default icon will be used instead. |
| 204 void SetIcon(SkBitmap* icon); | 205 void SetIcon(const SkBitmap* icon); |
| 205 | 206 |
| 206 // Starts the process of showing a confirmation UI, which is split into two. | 207 // Starts the process of showing a confirmation UI, which is split into two. |
| 207 // 1) Set off a 'load icon' task. | 208 // 1) Set off a 'load icon' task. |
| 208 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 209 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| 209 void ShowConfirmation(PromptType prompt_type); | 210 void ShowConfirmation(PromptType prompt_type); |
| 210 | 211 |
| 211 // Returns the delegate to control the browser's info bar. This is | 212 // Returns the delegate to control the browser's info bar. This is |
| 212 // within its own function due to its platform-specific nature. | 213 // within its own function due to its platform-specific nature. |
| 213 static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( | 214 static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( |
| 214 TabContentsWrapper* tab_contents, | 215 TabContentsWrapper* tab_contents, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 244 | 245 |
| 245 // Whether to show an installed bubble on app install, or use the default | 246 // Whether to show an installed bubble on app install, or use the default |
| 246 // action of opening a new tab page. | 247 // action of opening a new tab page. |
| 247 bool use_app_installed_bubble_; | 248 bool use_app_installed_bubble_; |
| 248 | 249 |
| 249 // Whether or not to show the default UI after completing the installation. | 250 // Whether or not to show the default UI after completing the installation. |
| 250 bool skip_post_install_ui_; | 251 bool skip_post_install_ui_; |
| 251 }; | 252 }; |
| 252 | 253 |
| 253 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 254 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| OLD | NEW |