| 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_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "chrome/browser/extensions/crx_installer_error.h" | 14 #include "chrome/browser/extensions/crx_installer_error.h" |
| 15 #include "chrome/browser/extensions/image_loading_tracker.h" | 15 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 16 #include "chrome/common/extensions/url_pattern.h" | 16 #include "chrome/common/extensions/url_pattern.h" |
| 17 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 17 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
| 18 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
| 19 #include "ui/gfx/image/image.h" | 19 #include "ui/gfx/image/image.h" |
| 20 #include "ui/gfx/image/image_skia.h" | 20 #include "ui/gfx/image/image_skia.h" |
| 21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 22 | 22 |
| 23 class Browser; | 23 class Browser; |
| 24 class ExtensionInstallDialog; |
| 24 class ExtensionInstallUI; | 25 class ExtensionInstallUI; |
| 25 class InfoBarDelegate; | 26 class InfoBarDelegate; |
| 26 class MessageLoop; | 27 class MessageLoop; |
| 27 class Profile; | 28 class Profile; |
| 28 | 29 |
| 29 namespace base { | 30 namespace base { |
| 30 class DictionaryValue; | 31 class DictionaryValue; |
| 31 } // namespace base | 32 } // namespace base |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. | 193 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| 193 virtual void ConfirmStandaloneInstall(Delegate* delegate, | 194 virtual void ConfirmStandaloneInstall(Delegate* delegate, |
| 194 const extensions::Extension* extension, | 195 const extensions::Extension* extension, |
| 195 SkBitmap* icon, | 196 SkBitmap* icon, |
| 196 const Prompt& prompt); | 197 const Prompt& prompt); |
| 197 | 198 |
| 198 // This is called by the installer to verify whether the installation from | 199 // This is called by the installer to verify whether the installation from |
| 199 // the webstore should proceed. | 200 // the webstore should proceed. |
| 200 // | 201 // |
| 201 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. | 202 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| 202 virtual void ConfirmWebstoreInstall(Delegate* delegate, | 203 virtual void ConfirmWebstoreInstall( |
| 203 const extensions::Extension* extension, | 204 Delegate* delegate, |
| 204 const SkBitmap* icon); | 205 const extensions::Extension* extension, |
| 206 const SkBitmap* icon, |
| 207 scoped_refptr<ExtensionInstallDialog> dialog); |
| 205 | 208 |
| 206 // This is called by the installer to verify whether the installation should | 209 // This is called by the installer to verify whether the installation should |
| 207 // proceed. This is declared virtual for testing. | 210 // proceed. This is declared virtual for testing. |
| 208 // | 211 // |
| 209 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. | 212 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| 210 virtual void ConfirmInstall(Delegate* delegate, | 213 virtual void ConfirmInstall(Delegate* delegate, |
| 211 const extensions::Extension* extension); | 214 const extensions::Extension* extension, |
| 215 scoped_refptr<ExtensionInstallDialog> dialog); |
| 212 | 216 |
| 213 // This is called by the app handler launcher to verify whether the app | 217 // This is called by the app handler launcher to verify whether the app |
| 214 // should be re-enabled. This is declared virtual for testing. | 218 // should be re-enabled. This is declared virtual for testing. |
| 215 // | 219 // |
| 216 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. | 220 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| 217 virtual void ConfirmReEnable(Delegate* delegate, | 221 virtual void ConfirmReEnable(Delegate* delegate, |
| 218 const extensions::Extension* extension); | 222 const extensions::Extension* extension); |
| 219 | 223 |
| 220 // This is called by the extension permissions API to verify whether an | 224 // This is called by the extension permissions API to verify whether an |
| 221 // extension may be granted additional permissions. | 225 // extension may be granted additional permissions. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 Prompt prompt_; | 308 Prompt prompt_; |
| 305 | 309 |
| 306 // The type of prompt we are going to show. | 310 // The type of prompt we are going to show. |
| 307 PromptType prompt_type_; | 311 PromptType prompt_type_; |
| 308 | 312 |
| 309 scoped_ptr<OAuth2MintTokenFlow> token_flow_; | 313 scoped_ptr<OAuth2MintTokenFlow> token_flow_; |
| 310 | 314 |
| 311 // Keeps track of extension images being loaded on the File thread for the | 315 // Keeps track of extension images being loaded on the File thread for the |
| 312 // purpose of showing the install UI. | 316 // purpose of showing the install UI. |
| 313 ImageLoadingTracker tracker_; | 317 ImageLoadingTracker tracker_; |
| 318 |
| 319 // Used to show the confirm dialog. |
| 320 scoped_refptr<ExtensionInstallDialog> dialog_; |
| 314 }; | 321 }; |
| 315 | 322 |
| 316 namespace chrome { | 323 namespace chrome { |
| 317 | 324 |
| 318 // Creates an ExtensionInstallPrompt from |browser|. Caller assumes ownership. | 325 // Creates an ExtensionInstallPrompt from |browser|. Caller assumes ownership. |
| 319 // TODO(beng): remove this once various extensions types are weaned from | 326 // TODO(beng): remove this once various extensions types are weaned from |
| 320 // Browser. | 327 // Browser. |
| 321 ExtensionInstallPrompt* CreateExtensionInstallPromptWithBrowser( | 328 ExtensionInstallPrompt* CreateExtensionInstallPromptWithBrowser( |
| 322 Browser* browser); | 329 Browser* browser); |
| 323 | 330 |
| 324 } // namespace chrome | 331 } // namespace chrome |
| 325 | 332 |
| 326 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 333 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |