Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 shortcut_shift(false) { | 233 shortcut_shift(false) { |
| 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 ExtensionOAuth2Scopes Extension::OAuth2Info::GetScopesAsSet() { | |
|
Yoyo Zhou
2012/04/24 23:16:36
nit: newline above this
jstritar
2012/04/24 23:33:34
Done.
| |
| 244 ExtensionOAuth2Scopes result; | |
| 245 std::copy(scopes.begin(), scopes.end(), | |
| 246 std::inserter(result, result.begin())); | |
| 247 return result; | |
| 248 } | |
| 243 | 249 |
| 244 Extension::ExtensionKeybinding::ExtensionKeybinding() {} | 250 Extension::ExtensionKeybinding::ExtensionKeybinding() {} |
| 245 Extension::ExtensionKeybinding::~ExtensionKeybinding() {} | 251 Extension::ExtensionKeybinding::~ExtensionKeybinding() {} |
| 246 | 252 |
| 247 ui::Accelerator Extension::ExtensionKeybinding::ParseImpl( | 253 ui::Accelerator Extension::ExtensionKeybinding::ParseImpl( |
| 248 const std::string& shortcut, | 254 const std::string& shortcut, |
| 249 const std::string& platform_key, | 255 const std::string& platform_key, |
| 250 int index, | 256 int index, |
| 251 string16* error) { | 257 string16* error) { |
| 252 if (platform_key != values::kKeybindingPlatformWin && | 258 if (platform_key != values::kKeybindingPlatformWin && |
| (...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3058 | 3064 |
| 3059 if (!LoadThemeFeatures(error)) | 3065 if (!LoadThemeFeatures(error)) |
| 3060 return false; | 3066 return false; |
| 3061 | 3067 |
| 3062 if (HasMultipleUISurfaces()) { | 3068 if (HasMultipleUISurfaces()) { |
| 3063 *error = ASCIIToUTF16(errors::kOneUISurfaceOnly); | 3069 *error = ASCIIToUTF16(errors::kOneUISurfaceOnly); |
| 3064 return false; | 3070 return false; |
| 3065 } | 3071 } |
| 3066 | 3072 |
| 3067 runtime_data_.SetActivePermissions(new ExtensionPermissionSet( | 3073 runtime_data_.SetActivePermissions(new ExtensionPermissionSet( |
| 3068 this, api_permissions, host_permissions)); | 3074 this, api_permissions, host_permissions, oauth2_info_.GetScopesAsSet())); |
| 3069 required_permission_set_ = new ExtensionPermissionSet( | 3075 required_permission_set_ = new ExtensionPermissionSet( |
| 3070 this, api_permissions, host_permissions); | 3076 this, api_permissions, host_permissions, oauth2_info_.GetScopesAsSet()); |
| 3071 optional_permission_set_ = new ExtensionPermissionSet( | 3077 optional_permission_set_ = new ExtensionPermissionSet( |
| 3072 optional_api_permissions, optional_host_permissions, URLPatternSet()); | 3078 optional_api_permissions, optional_host_permissions, URLPatternSet()); |
| 3073 | 3079 |
| 3074 return true; | 3080 return true; |
| 3075 } | 3081 } |
| 3076 | 3082 |
| 3077 GURL Extension::GetHomepageURL() const { | 3083 GURL Extension::GetHomepageURL() const { |
| 3078 if (homepage_url_.is_valid()) | 3084 if (homepage_url_.is_valid()) |
| 3079 return homepage_url_; | 3085 return homepage_url_; |
| 3080 | 3086 |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3647 already_disabled(false), | 3653 already_disabled(false), |
| 3648 extension(extension) {} | 3654 extension(extension) {} |
| 3649 | 3655 |
| 3650 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3656 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3651 const Extension* extension, | 3657 const Extension* extension, |
| 3652 const ExtensionPermissionSet* permissions, | 3658 const ExtensionPermissionSet* permissions, |
| 3653 Reason reason) | 3659 Reason reason) |
| 3654 : reason(reason), | 3660 : reason(reason), |
| 3655 extension(extension), | 3661 extension(extension), |
| 3656 permissions(permissions) {} | 3662 permissions(permissions) {} |
| OLD | NEW |