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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 errors::kInvalidKeyBinding, | 282 errors::kInvalidKeyBinding, |
283 base::IntToString(index), | 283 base::IntToString(index), |
284 original_keybinding); | 284 original_keybinding); |
285 return false; | 285 return false; |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 // We support Ctrl+foo, Alt+foo, Ctrl+Shift+foo, Alt+Shift+foo, but not | 289 // We support Ctrl+foo, Alt+foo, Ctrl+Shift+foo, Alt+Shift+foo, but not |
290 // Ctrl+Alt+foo. For a more detailed reason why we don't support Ctrl+Alt+foo: | 290 // Ctrl+Alt+foo. For a more detailed reason why we don't support Ctrl+Alt+foo: |
291 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx. | 291 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx. |
292 if (key == ui::VKEY_UNKNOWN || (ctrl == true && alt == true)) { | 292 if (key == ui::VKEY_UNKNOWN || (ctrl && alt)) { |
293 *error = ExtensionErrorUtils::FormatErrorMessageUTF16( | 293 *error = ExtensionErrorUtils::FormatErrorMessageUTF16( |
294 errors::kInvalidKeyBinding, | 294 errors::kInvalidKeyBinding, |
295 base::IntToString(index), | 295 base::IntToString(index), |
296 original_keybinding); | 296 original_keybinding); |
297 return false; | 297 return false; |
298 } | 298 } |
299 | 299 |
300 accelerator_ = ui::Accelerator(key, shift, ctrl, alt); | 300 accelerator_ = ui::Accelerator(key, shift, ctrl, alt); |
301 | 301 |
302 if (command_name != | 302 if (command_name != |
(...skipping 2894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3197 already_disabled(false), | 3197 already_disabled(false), |
3198 extension(extension) {} | 3198 extension(extension) {} |
3199 | 3199 |
3200 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3200 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3201 const Extension* extension, | 3201 const Extension* extension, |
3202 const ExtensionPermissionSet* permissions, | 3202 const ExtensionPermissionSet* permissions, |
3203 Reason reason) | 3203 Reason reason) |
3204 : reason(reason), | 3204 : reason(reason), |
3205 extension(extension), | 3205 extension(extension), |
3206 permissions(permissions) {} | 3206 permissions(permissions) {} |
OLD | NEW |