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

Unified Diff: chrome/browser/extensions/permissions_updater.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/browser/extensions/permissions_updater.cc
===================================================================
--- chrome/browser/extensions/permissions_updater.cc (revision 179928)
+++ chrome/browser/extensions/permissions_updater.cc (working copy)
@@ -16,6 +16,7 @@
#include "chrome/browser/signin/token_service.h"
#include "chrome/browser/signin/token_service_factory.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
#include "chrome/common/extensions/api/permissions.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -50,8 +51,8 @@
TokenServiceFactory::GetForProfile(profile)->
GetOAuth2LoginRefreshToken(),
extension->id(),
- extension->oauth2_info().client_id,
- extension->oauth2_info().scopes,
+ OAuth2Info::GetOAuth2Info(extension).client_id,
+ OAuth2Info::GetOAuth2Info(extension).scopes,
OAuth2MintTokenFlow::MODE_RECORD_GRANT))) {
notification_registrar_.Add(this,
chrome::NOTIFICATION_PROFILE_DESTROYED,
@@ -143,7 +144,7 @@
// Only record OAuth grant if:
// 1. The extension has client id and scopes.
// 2. The user is signed in to Chrome.
- const Extension::OAuth2Info& oauth2_info = extension->oauth2_info();
+ const OAuth2Info& oauth2_info = OAuth2Info::GetOAuth2Info(extension);
if (!oauth2_info.client_id.empty() && !oauth2_info.scopes.empty()) {
TokenService* token_service = TokenServiceFactory::GetForProfile(
profile_);
@@ -168,7 +169,7 @@
const char* event_name,
const PermissionSet* changed_permissions) {
if (!profile_ ||
- !extensions::ExtensionSystem::Get(profile_)->event_router())
+ !ExtensionSystem::Get(profile_)->event_router())
return;
scoped_ptr<ListValue> value(new ListValue());
@@ -227,8 +228,7 @@
}
ExtensionPrefs* PermissionsUpdater::GetExtensionPrefs() {
- return extensions::ExtensionSystem::Get(profile_)->extension_service()->
- extension_prefs();
+ return ExtensionSystem::Get(profile_)->extension_service()->extension_prefs();
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | chrome/browser/profiles/profile_dependency_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698