Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: chrome/browser/extensions/extension_install_prompt.cc

Issue 23978007: Identity API: prevent install time OAuth prompts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index 7045625fa0fcf90e02aa636853680669a3f010f2..866041622942c81eb6e47c0b3c8bff3c4da8ebd1 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -112,8 +112,6 @@ static const int kOAuthHeaderIds[ExtensionInstallPrompt::NUM_PROMPT_TYPES] = {
0, // Bundle installs don't show OAuth permissions.
IDS_EXTENSION_PROMPT_OAUTH_REENABLE_HEADER,
IDS_EXTENSION_PROMPT_OAUTH_PERMISSIONS_HEADER,
- // TODO(mpcomplete): Do we need this for external install UI? If we do,
- // we need to update FetchOAuthIssueAdviceIfNeeded.
0,
0,
};
@@ -553,7 +551,7 @@ void ExtensionInstallPrompt::ConfirmBundleInstall(
delegate_ = bundle;
prompt_.set_type(BUNDLE_INSTALL_PROMPT);
- FetchOAuthIssueAdviceIfNeeded();
+ ShowConfirmation();
}
void ExtensionInstallPrompt::ConfirmStandaloneInstall(
@@ -568,7 +566,7 @@ void ExtensionInstallPrompt::ConfirmStandaloneInstall(
prompt_ = prompt;
SetIcon(icon);
- FetchOAuthIssueAdviceIfNeeded();
+ ShowConfirmation();
}
void ExtensionInstallPrompt::ConfirmWebstoreInstall(
@@ -707,14 +705,14 @@ void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) {
void ExtensionInstallPrompt::OnImageLoaded(const gfx::Image& image) {
SetIcon(image.IsEmpty() ? NULL : image.ToSkBitmap());
- FetchOAuthIssueAdviceIfNeeded();
+ ShowConfirmation();
}
void ExtensionInstallPrompt::LoadImageIfNeeded() {
// Bundle install prompts do not have an icon.
// Also |install_ui_.profile()| can be NULL in unit tests.
if (!icon_.empty() || !install_ui_->profile()) {
- FetchOAuthIssueAdviceIfNeeded();
+ ShowConfirmation();
return;
}
@@ -733,37 +731,6 @@ void ExtensionInstallPrompt::LoadImageIfNeeded() {
base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr()));
}
-void ExtensionInstallPrompt::FetchOAuthIssueAdviceIfNeeded() {
- // |extension_| may be NULL, e.g. in the bundle install case.
- if (!extension_ ||
- prompt_.type() == BUNDLE_INSTALL_PROMPT ||
- prompt_.type() == INLINE_INSTALL_PROMPT ||
- prompt_.type() == EXTERNAL_INSTALL_PROMPT ||
- prompt_.GetOAuthIssueCount() != 0U) {
- ShowConfirmation();
- return;
- }
-
- const extensions::OAuth2Info& oauth2_info =
- extensions::OAuth2Info::GetOAuth2Info(extension_);
- if (oauth2_info.client_id.empty() ||
- oauth2_info.scopes.empty()) {
- ShowConfirmation();
- return;
- }
-
- ProfileOAuth2TokenService* token_service =
- ProfileOAuth2TokenServiceFactory::GetForProfile(install_ui_->profile());
- if (!token_service || !token_service->RefreshTokenIsAvailable()) {
- ShowConfirmation();
- return;
- }
-
- // Get an access token from the token service.
- login_token_request_ = token_service->StartRequest(
- OAuth2TokenService::ScopeSet(), this);
-}
-
void ExtensionInstallPrompt::OnGetTokenSuccess(
const OAuth2TokenService::Request* request,
const std::string& access_token,
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698