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

Side by Side Diff: chrome/common/extensions/extension.cc

Issue 10049006: Add OAuth2 scopes to the ExtensionPermissionSet and granted permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/common/extensions/extension.h" 5 #include "chrome/common/extensions/extension.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 Extension::InputComponentInfo::~InputComponentInfo() {} 236 Extension::InputComponentInfo::~InputComponentInfo() {}
237 237
238 Extension::TtsVoice::TtsVoice() {} 238 Extension::TtsVoice::TtsVoice() {}
239 Extension::TtsVoice::~TtsVoice() {} 239 Extension::TtsVoice::~TtsVoice() {}
240 240
241 Extension::OAuth2Info::OAuth2Info() {} 241 Extension::OAuth2Info::OAuth2Info() {}
242 Extension::OAuth2Info::~OAuth2Info() {} 242 Extension::OAuth2Info::~OAuth2Info() {}
243 243
244 ExtensionOAuth2Scopes Extension::OAuth2Info::GetScopesAsSet() {
245 ExtensionOAuth2Scopes result;
246 std::copy(scopes.begin(), scopes.end(),
247 std::inserter(result, result.begin()));
248 return result;
249 }
250
244 Extension::ExtensionKeybinding::ExtensionKeybinding() {} 251 Extension::ExtensionKeybinding::ExtensionKeybinding() {}
245 Extension::ExtensionKeybinding::~ExtensionKeybinding() {} 252 Extension::ExtensionKeybinding::~ExtensionKeybinding() {}
246 253
247 ui::Accelerator Extension::ExtensionKeybinding::ParseImpl( 254 ui::Accelerator Extension::ExtensionKeybinding::ParseImpl(
248 const std::string& shortcut, 255 const std::string& shortcut,
249 const std::string& platform_key, 256 const std::string& platform_key,
250 int index, 257 int index,
251 string16* error) { 258 string16* error) {
252 if (platform_key != values::kKeybindingPlatformWin && 259 if (platform_key != values::kKeybindingPlatformWin &&
253 platform_key != values::kKeybindingPlatformMac && 260 platform_key != values::kKeybindingPlatformMac &&
(...skipping 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 3065
3059 if (!LoadThemeFeatures(error)) 3066 if (!LoadThemeFeatures(error))
3060 return false; 3067 return false;
3061 3068
3062 if (HasMultipleUISurfaces()) { 3069 if (HasMultipleUISurfaces()) {
3063 *error = ASCIIToUTF16(errors::kOneUISurfaceOnly); 3070 *error = ASCIIToUTF16(errors::kOneUISurfaceOnly);
3064 return false; 3071 return false;
3065 } 3072 }
3066 3073
3067 runtime_data_.SetActivePermissions(new ExtensionPermissionSet( 3074 runtime_data_.SetActivePermissions(new ExtensionPermissionSet(
3068 this, api_permissions, host_permissions)); 3075 this, api_permissions, host_permissions, oauth2_info_.GetScopesAsSet()));
3069 required_permission_set_ = new ExtensionPermissionSet( 3076 required_permission_set_ = new ExtensionPermissionSet(
3070 this, api_permissions, host_permissions); 3077 this, api_permissions, host_permissions, oauth2_info_.GetScopesAsSet());
3071 optional_permission_set_ = new ExtensionPermissionSet( 3078 optional_permission_set_ = new ExtensionPermissionSet(
3072 optional_api_permissions, optional_host_permissions, URLPatternSet()); 3079 optional_api_permissions, optional_host_permissions, URLPatternSet());
3073 3080
3074 return true; 3081 return true;
3075 } 3082 }
3076 3083
3077 GURL Extension::GetHomepageURL() const { 3084 GURL Extension::GetHomepageURL() const {
3078 if (homepage_url_.is_valid()) 3085 if (homepage_url_.is_valid())
3079 return homepage_url_; 3086 return homepage_url_;
3080 3087
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 already_disabled(false), 3654 already_disabled(false),
3648 extension(extension) {} 3655 extension(extension) {}
3649 3656
3650 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( 3657 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo(
3651 const Extension* extension, 3658 const Extension* extension,
3652 const ExtensionPermissionSet* permissions, 3659 const ExtensionPermissionSet* permissions,
3653 Reason reason) 3660 Reason reason)
3654 : reason(reason), 3661 : reason(reason),
3655 extension(extension), 3662 extension(extension),
3656 permissions(permissions) {} 3663 permissions(permissions) {}
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_permission_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698