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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace content { | 33 namespace content { |
34 class PageNavigator; | 34 class PageNavigator; |
35 class WebContents; | 35 class WebContents; |
36 } | 36 } |
37 | 37 |
38 namespace extensions { | 38 namespace extensions { |
39 class BundleInstaller; | 39 class BundleInstaller; |
40 class Extension; | 40 class Extension; |
41 class ExtensionWebstorePrivateApiTest; | 41 class ExtensionWebstorePrivateApiTest; |
| 42 class MockGetAuthTokenFunction; |
42 class PermissionSet; | 43 class PermissionSet; |
43 } // namespace extensions | 44 } // namespace extensions |
44 | 45 |
45 // Displays all the UI around extension installation. | 46 // Displays all the UI around extension installation. |
46 class ExtensionInstallPrompt | 47 class ExtensionInstallPrompt |
47 : public OAuth2MintTokenFlow::Delegate, | 48 : public OAuth2MintTokenFlow::Delegate, |
48 public base::SupportsWeakPtr<ExtensionInstallPrompt> { | 49 public base::SupportsWeakPtr<ExtensionInstallPrompt> { |
49 public: | 50 public: |
50 enum PromptType { | 51 enum PromptType { |
51 UNSET_PROMPT_TYPE = -1, | 52 UNSET_PROMPT_TYPE = -1, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 291 |
291 // Installation was successful. This is declared virtual for testing. | 292 // Installation was successful. This is declared virtual for testing. |
292 virtual void OnInstallSuccess(const extensions::Extension* extension, | 293 virtual void OnInstallSuccess(const extensions::Extension* extension, |
293 SkBitmap* icon); | 294 SkBitmap* icon); |
294 | 295 |
295 // Installation failed. This is declared virtual for testing. | 296 // Installation failed. This is declared virtual for testing. |
296 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); | 297 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); |
297 | 298 |
298 protected: | 299 protected: |
299 friend class extensions::ExtensionWebstorePrivateApiTest; | 300 friend class extensions::ExtensionWebstorePrivateApiTest; |
| 301 friend class extensions::MockGetAuthTokenFunction; |
300 friend class WebstoreStandaloneInstallUnpackFailureTest; | 302 friend class WebstoreStandaloneInstallUnpackFailureTest; |
301 friend class MockGetAuthTokenFunction; | |
302 | 303 |
303 // Whether or not we should record the oauth2 grant upon successful install. | 304 // Whether or not we should record the oauth2 grant upon successful install. |
304 bool record_oauth2_grant_; | 305 bool record_oauth2_grant_; |
305 | 306 |
306 private: | 307 private: |
307 friend class GalleryInstallApiTestObserver; | 308 friend class GalleryInstallApiTestObserver; |
308 | 309 |
309 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains | 310 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains |
310 // an empty bitmap, then a default icon will be used instead. | 311 // an empty bitmap, then a default icon will be used instead. |
311 void SetIcon(const SkBitmap* icon); | 312 void SetIcon(const SkBitmap* icon); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 // A pre-filled prompt. | 358 // A pre-filled prompt. |
358 Prompt prompt_; | 359 Prompt prompt_; |
359 | 360 |
360 scoped_ptr<OAuth2MintTokenFlow> token_flow_; | 361 scoped_ptr<OAuth2MintTokenFlow> token_flow_; |
361 | 362 |
362 // Used to show the confirm dialog. | 363 // Used to show the confirm dialog. |
363 ShowDialogCallback show_dialog_callback_; | 364 ShowDialogCallback show_dialog_callback_; |
364 }; | 365 }; |
365 | 366 |
366 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 367 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
OLD | NEW |