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/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa .h" | 5 #include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa .h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/commands/command_service.h" | 7 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
| 12 #include "chrome/common/extensions/extension_manifest_constants.h" | 12 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 13 #include "content/public/browser/native_web_keyboard_event.h" | 13 #include "content/public/browser/native_web_keyboard_event.h" |
| 14 #include "content/public/browser/notification_service.h" | 14 #include "content/public/browser/notification_service.h" |
| 15 | 15 |
| 16 namespace values = extension_manifest_values; | 16 namespace values = extension_manifest_values; |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 void extensions::ExtensionKeybindingRegistry::SetShortcutHandlingSuspended( | 19 void extensions::ExtensionKeybindingRegistry::SetShortcutHandlingSuspended( |
| 20 bool suspended) { | 20 bool suspended) { |
| 21 ExtensionKeybindingRegistryCocoa::set_shortcut_handling_suspended(suspended); | 21 ExtensionKeybindingRegistryCocoa::set_shortcut_handling_suspended(suspended); |
| 22 } | 22 } |
| 23 | 23 |
| 24 // static | |
| 25 bool extensions::ExtensionKeybindingRegistry::IsChromeAccelerator( | |
| 26 const ui::Accelerator& accelerator) { | |
| 27 // TODO(finnur): Implement this. | |
|
Yoyo Zhou
2013/04/05 18:09:50
Is the issue that AcceleratorsCocoa doesn't give y
Finnur
2013/04/05 19:50:03
The issue is that the CL for Views and GTK was rea
| |
| 28 return false; | |
| 29 } | |
| 30 | |
| 24 bool ExtensionKeybindingRegistryCocoa::shortcut_handling_suspended_ = false; | 31 bool ExtensionKeybindingRegistryCocoa::shortcut_handling_suspended_ = false; |
| 25 | 32 |
| 26 ExtensionKeybindingRegistryCocoa::ExtensionKeybindingRegistryCocoa( | 33 ExtensionKeybindingRegistryCocoa::ExtensionKeybindingRegistryCocoa( |
| 27 Profile* profile, | 34 Profile* profile, |
| 28 gfx::NativeWindow window, | 35 gfx::NativeWindow window, |
| 29 ExtensionFilter extension_filter, | 36 ExtensionFilter extension_filter, |
| 30 Delegate* delegate) | 37 Delegate* delegate) |
| 31 : ExtensionKeybindingRegistry(profile, extension_filter, delegate), | 38 : ExtensionKeybindingRegistry(profile, extension_filter, delegate), |
| 32 profile_(profile), | 39 profile_(profile), |
| 33 window_(window) { | 40 window_(window) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 const extensions::Extension* extension, | 146 const extensions::Extension* extension, |
| 140 const std::string& command_name) { | 147 const std::string& command_name) { |
| 141 EventTargets::iterator iter = event_targets_.begin(); | 148 EventTargets::iterator iter = event_targets_.begin(); |
| 142 while (iter != event_targets_.end()) { | 149 while (iter != event_targets_.end()) { |
| 143 EventTargets::iterator old = iter++; | 150 EventTargets::iterator old = iter++; |
| 144 if (old->second.first == extension->id() && | 151 if (old->second.first == extension->id() && |
| 145 (command_name.empty() || (old->second.second == command_name))) | 152 (command_name.empty() || (old->second.second == command_name))) |
| 146 event_targets_.erase(old); | 153 event_targets_.erase(old); |
| 147 } | 154 } |
| 148 } | 155 } |
| OLD | NEW |