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

Side by Side Diff: chrome/browser/extensions/extension_install_prompt.cc

Issue 11882025: Move "oauth2" manifest key parsing out of Extension class. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/extensions/extension_install_prompt.h" 5 #include "chrome/browser/extensions/extension_install_prompt.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/stringprintf.h" 14 #include "base/stringprintf.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/extensions/bundle_installer.h" 16 #include "chrome/browser/extensions/bundle_installer.h"
17 #include "chrome/browser/extensions/extension_install_ui.h" 17 #include "chrome/browser/extensions/extension_install_ui.h"
18 #include "chrome/browser/extensions/image_loader.h" 18 #include "chrome/browser/extensions/image_loader.h"
19 #include "chrome/browser/prefs/pref_service.h" 19 #include "chrome/browser/prefs/pref_service.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/signin/token_service.h" 21 #include "chrome/browser/signin/token_service.h"
22 #include "chrome/browser/signin/token_service_factory.h" 22 #include "chrome/browser/signin/token_service_factory.h"
23 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/browser_window.h" 24 #include "chrome/browser/ui/browser_window.h"
25 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
26 #include "chrome/common/extensions/extension.h" 27 #include "chrome/common/extensions/extension.h"
27 #include "chrome/common/extensions/extension_constants.h" 28 #include "chrome/common/extensions/extension_constants.h"
28 #include "chrome/common/extensions/extension_icon_set.h" 29 #include "chrome/common/extensions/extension_icon_set.h"
29 #include "chrome/common/extensions/extension_manifest_constants.h" 30 #include "chrome/common/extensions/extension_manifest_constants.h"
30 #include "chrome/common/extensions/extension_resource.h" 31 #include "chrome/common/extensions/extension_resource.h"
31 #include "chrome/common/extensions/feature_switch.h" 32 #include "chrome/common/extensions/feature_switch.h"
32 #include "chrome/common/extensions/manifest.h" 33 #include "chrome/common/extensions/manifest.h"
33 #include "chrome/common/extensions/permissions/permission_set.h" 34 #include "chrome/common/extensions/permissions/permission_set.h"
34 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
35 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 // |extension_| may be NULL, e.g. in the bundle install case. 619 // |extension_| may be NULL, e.g. in the bundle install case.
619 if (!extension_ || 620 if (!extension_ ||
620 prompt_.type() == BUNDLE_INSTALL_PROMPT || 621 prompt_.type() == BUNDLE_INSTALL_PROMPT ||
621 prompt_.type() == INLINE_INSTALL_PROMPT || 622 prompt_.type() == INLINE_INSTALL_PROMPT ||
622 prompt_.type() == EXTERNAL_INSTALL_PROMPT || 623 prompt_.type() == EXTERNAL_INSTALL_PROMPT ||
623 prompt_.GetOAuthIssueCount() != 0U) { 624 prompt_.GetOAuthIssueCount() != 0U) {
624 ShowConfirmation(); 625 ShowConfirmation();
625 return; 626 return;
626 } 627 }
627 628
628 const Extension::OAuth2Info& oauth2_info = extension_->oauth2_info(); 629 const extensions::OAuth2Info& oauth2_info =
630 extensions::OAuth2Info::GetOAuth2Info(extension_);
629 if (oauth2_info.client_id.empty() || 631 if (oauth2_info.client_id.empty() ||
630 oauth2_info.scopes.empty()) { 632 oauth2_info.scopes.empty()) {
631 ShowConfirmation(); 633 ShowConfirmation();
632 return; 634 return;
633 } 635 }
634 636
635 Profile* profile = install_ui_->profile(); 637 Profile* profile = install_ui_->profile();
636 TokenService* token_service = TokenServiceFactory::GetForProfile(profile); 638 TokenService* token_service = TokenServiceFactory::GetForProfile(profile);
637 639
638 token_flow_.reset(new OAuth2MintTokenFlow( 640 token_flow_.reset(new OAuth2MintTokenFlow(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 } 690 }
689 691
690 if (AutoConfirmPrompt(delegate_)) 692 if (AutoConfirmPrompt(delegate_))
691 return; 693 return;
692 694
693 if (show_dialog_callback_.is_null()) 695 if (show_dialog_callback_.is_null())
694 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); 696 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_);
695 else 697 else
696 show_dialog_callback_.Run(show_params_, delegate_, prompt_); 698 show_dialog_callback_.Run(show_params_, delegate_, prompt_);
697 } 699 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.h ('k') | chrome/browser/extensions/permissions_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698