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

Unified Diff: chrome/common/extensions/extension.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, 11 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
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 179928)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -256,9 +256,6 @@
Extension::Requirements::~Requirements() {}
-Extension::OAuth2Info::OAuth2Info() {}
-Extension::OAuth2Info::~OAuth2Info() {}
-
//
// Extension
//
@@ -1856,8 +1853,7 @@
!LoadBackgroundScripts(error) ||
!LoadBackgroundPage(api_permissions, error) ||
!LoadBackgroundPersistent(api_permissions, error) ||
- !LoadBackgroundAllowJSAccess(api_permissions, error) ||
- !LoadOAuth2Info(error))
+ !LoadBackgroundAllowJSAccess(api_permissions, error))
return false;
return true;
@@ -2828,34 +2824,6 @@
return true;
}
-bool Extension::LoadOAuth2Info(string16* error) {
- if (!manifest_->HasKey(keys::kOAuth2))
- return true;
-
- if (!manifest_->GetString(keys::kOAuth2ClientId, &oauth2_info_.client_id) ||
- oauth2_info_.client_id.empty()) {
- *error = ASCIIToUTF16(errors::kInvalidOAuth2ClientId);
- return false;
- }
-
- ListValue* list = NULL;
- if (!manifest_->GetList(keys::kOAuth2Scopes, &list)) {
- *error = ASCIIToUTF16(errors::kInvalidOAuth2Scopes);
- return false;
- }
-
- for (size_t i = 0; i < list->GetSize(); ++i) {
- std::string scope;
- if (!list->GetString(i, &scope)) {
- *error = ASCIIToUTF16(errors::kInvalidOAuth2Scopes);
- return false;
- }
- oauth2_info_.scopes.push_back(scope);
- }
-
- return true;
-}
-
bool Extension::HasMultipleUISurfaces() const {
int num_surfaces = 0;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/manifest_tests/extension_manifests_auth_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698