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

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 177049)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
sail 2013/01/23 20:23:15 same
SanjoyPal 2013/01/23 20:35:41 Done.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -341,9 +341,6 @@
Extension::Requirements::~Requirements() {}
-Extension::OAuth2Info::OAuth2Info() {}
-Extension::OAuth2Info::~OAuth2Info() {}
-
Extension::ActionInfo::ActionInfo() {}
Extension::ActionInfo::~ActionInfo() {}
@@ -1976,8 +1973,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;
@@ -3268,34 +3264,6 @@
return result.Pass();
}
-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;

Powered by Google App Engine
This is Rietveld 408576698