| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 const Extension* extension, | 141 const Extension* extension, |
| 142 const ExtensionPermissionSet* permissions); | 142 const ExtensionPermissionSet* permissions); |
| 143 | 143 |
| 144 // Installation was successful. This is declared virtual for testing. | 144 // Installation was successful. This is declared virtual for testing. |
| 145 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon); | 145 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon); |
| 146 | 146 |
| 147 // Installation failed. This is declared virtual for testing. | 147 // Installation failed. This is declared virtual for testing. |
| 148 virtual void OnInstallFailure(const string16& error); | 148 virtual void OnInstallFailure(const string16& error); |
| 149 | 149 |
| 150 // ImageLoadingTracker::Observer: | 150 // ImageLoadingTracker::Observer: |
| 151 virtual void OnImageLoaded( | 151 virtual void OnImageLoaded(const gfx::Image* image, |
| 152 SkBitmap* image, const ExtensionResource& resource, int index) OVERRIDE; | 152 const std::string& extension_id, |
| 153 int index) OVERRIDE; |
| 153 | 154 |
| 154 // Opens a new tab page and animates the app icon for the app with id | 155 // Opens a new tab page and animates the app icon for the app with id |
| 155 // |app_id|. | 156 // |app_id|. |
| 156 static void OpenAppInstalledNTP(Browser* browser, const std::string& app_id); | 157 static void OpenAppInstalledNTP(Browser* browser, const std::string& app_id); |
| 157 | 158 |
| 158 protected: | 159 protected: |
| 159 friend class ExtensionWebstorePrivateApiTest; | 160 friend class ExtensionWebstorePrivateApiTest; |
| 160 friend class WebstoreInlineInstallUnpackFailureTest; | 161 friend class WebstoreInlineInstallUnpackFailureTest; |
| 161 | 162 |
| 162 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only | 163 // Disables showing UI (ErrorBox, etc.) for install failures. To be used only |
| 163 // in tests. | 164 // in tests. |
| 164 static void DisableFailureUIForTests(); | 165 static void DisableFailureUIForTests(); |
| 165 | 166 |
| 166 private: | 167 private: |
| 167 friend class GalleryInstallApiTestObserver; | 168 friend class GalleryInstallApiTestObserver; |
| 168 | 169 |
| 169 // Show an infobar for a newly-installed theme. previous_theme_id | 170 // Show an infobar for a newly-installed theme. previous_theme_id |
| 170 // should be empty if the previous theme was the system/default | 171 // should be empty if the previous theme was the system/default |
| 171 // theme. | 172 // theme. |
| 172 static void ShowThemeInfoBar( | 173 static void ShowThemeInfoBar( |
| 173 const std::string& previous_theme_id, bool previous_using_native_theme, | 174 const std::string& previous_theme_id, bool previous_using_native_theme, |
| 174 const Extension* new_theme, Profile* profile); | 175 const Extension* new_theme, Profile* profile); |
| 175 | 176 |
| 176 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains | 177 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains |
| 177 // an empty bitmap, then a default icon will be used instead. | 178 // an empty bitmap, then a default icon will be used instead. |
| 178 void SetIcon(SkBitmap* icon); | 179 void SetIcon(const SkBitmap* icon); |
| 179 | 180 |
| 180 // Starts the process of showing a confirmation UI, which is split into two. | 181 // Starts the process of showing a confirmation UI, which is split into two. |
| 181 // 1) Set off a 'load icon' task. | 182 // 1) Set off a 'load icon' task. |
| 182 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 183 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| 183 void ShowConfirmation(PromptType prompt_type); | 184 void ShowConfirmation(PromptType prompt_type); |
| 184 | 185 |
| 185 // Returns the delegate to control the browser's info bar. This is | 186 // Returns the delegate to control the browser's info bar. This is |
| 186 // within its own function due to its platform-specific nature. | 187 // within its own function due to its platform-specific nature. |
| 187 static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( | 188 static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( |
| 188 TabContentsWrapper* tab_contents, | 189 TabContentsWrapper* tab_contents, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 218 | 219 |
| 219 // Whether to show an installed bubble on app install, or use the default | 220 // Whether to show an installed bubble on app install, or use the default |
| 220 // action of opening a new tab page. | 221 // action of opening a new tab page. |
| 221 bool use_app_installed_bubble_; | 222 bool use_app_installed_bubble_; |
| 222 | 223 |
| 223 // Whether or not to show the default UI after completing the installation. | 224 // Whether or not to show the default UI after completing the installation. |
| 224 bool skip_post_install_ui_; | 225 bool skip_post_install_ui_; |
| 225 }; | 226 }; |
| 226 | 227 |
| 227 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ | 228 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |
| OLD | NEW |