Chromium Code Reviews| Index: chrome/browser/extensions/extension_install_prompt.h |
| diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h |
| index ce1f546937ba7bbb90173077cd5c8fd29c104e99..3873251fbe95e5c95ec43114e1dcce82b27cc4a6 100644 |
| --- a/chrome/browser/extensions/extension_install_prompt.h |
| +++ b/chrome/browser/extensions/extension_install_prompt.h |
| @@ -15,6 +15,7 @@ |
| #include "chrome/browser/extensions/crx_installer_error.h" |
| #include "chrome/browser/extensions/image_loading_tracker.h" |
| #include "chrome/common/extensions/url_pattern.h" |
| +#include "chrome/common/net/gaia/oauth2_mint_token_flow.h" |
| #include "third_party/skia/include/core/SkBitmap.h" |
| #include "ui/gfx/image/image.h" |
| #include "ui/gfx/image/image_skia.h" |
| @@ -37,7 +38,8 @@ class ExtensionWebstorePrivateApiTest; |
| } // namespace extensions |
| // Displays all the UI around extension installation. |
| -class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| +class ExtensionInstallPrompt : public ImageLoadingTracker::Observer, |
| + public OAuth2MintTokenFlow::Delegate { |
| public: |
| enum PromptType { |
| UNSET_PROMPT_TYPE = -1, |
| @@ -62,6 +64,7 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| void SetInlineInstallWebstoreData(const std::string& localized_user_count, |
| double average_rating, |
| int rating_count); |
| + void SetOAuthIssues(const IssueAdviceInfo& issues); |
| PromptType type() const { return type_; } |
| void set_type(PromptType type) { type_ = type; } |
| @@ -87,6 +90,8 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| string16 GetUserCount() const; |
| size_t GetPermissionCount() const; |
| string16 GetPermission(size_t index) const; |
| + size_t GetOAuthIssueCount() const; |
| + const IssueAdviceInfoEntry& GetOAuthIssue(size_t index) const; |
| // Populated for BUNDLE_INSTALL_PROMPT. |
| const extensions::BundleInstaller* bundle() const { return bundle_; } |
| @@ -109,6 +114,10 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| // permissions if only additional ones are being requested) |
| std::vector<string16> permissions_; |
| + // Descriptions and details for OAuth2 permissions to display to the user. |
| + // These correspond to permission scopes. |
| + IssueAdviceInfo oauth_issues_; |
| + |
| // The extension or bundle being installed. |
| const extensions::Extension* extension_; |
| const extensions::BundleInstaller* bundle_; |
| @@ -155,6 +164,8 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| ExtensionInstallUI* install_ui() const { return install_ui_.get(); } |
| + bool record_oauth2_grant() const { return record_oauth2_grant_; } |
| + |
| // This is called by the bundle installer to verify whether the bundle |
| // should be installed. |
| // |
| @@ -229,6 +240,15 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| void LoadImageIfNeeded(); |
| + // Starts fetching warnings for OAuth2 scopes, if there are any. |
| + void FetchOAuthIssuesIfNeeded(); |
|
jstritar
2012/06/25 15:10:35
Nice, glad you moved this in here... seems like th
Munjal (Google)
2012/06/25 20:40:09
Nit: Can we name this FetchOAuthIssueAdviceIfNeede
Evan Stade
2012/06/26 00:56:03
changed here and elsewhere.
|
| + |
| + // OAuth2MintTokenFlow::Delegate implementation: |
| + virtual void OnIssueAdviceSuccess( |
| + const IssueAdviceInfo& issue_advice) OVERRIDE; |
| + virtual void OnMintTokenFailure( |
| + const GoogleServiceAuthError& error) OVERRIDE; |
| + |
| // Shows the actual UI (the icon should already be loaded). |
| void ShowConfirmation(); |
| @@ -259,6 +279,11 @@ class ExtensionInstallPrompt : public ImageLoadingTracker::Observer { |
| // The type of prompt we are going to show. |
| PromptType prompt_type_; |
| + // Whether or not we should record the oauth2 grant upon successful install. |
| + bool record_oauth2_grant_; |
| + |
| + scoped_refptr<OAuth2MintTokenFlow> token_flow_; |
| + |
| // Keeps track of extension images being loaded on the File thread for the |
| // purpose of showing the install UI. |
| ImageLoadingTracker tracker_; |