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/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/extensions/api/commands/command_service.h" | 8 #include "chrome/browser/extensions/api/commands/command_service.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return false; | 54 return false; |
55 | 55 |
56 const ui::AcceleratorManager::HandlerPriority accelerator_priority = | 56 const ui::AcceleratorManager::HandlerPriority accelerator_priority = |
57 GetAcceleratorPriorityById(accelerator, extension_id, profile_); | 57 GetAcceleratorPriorityById(accelerator, extension_id, profile_); |
58 // Only handle the event if it has the right priority. | 58 // Only handle the event if it has the right priority. |
59 if (priority != accelerator_priority) | 59 if (priority != accelerator_priority) |
60 return false; | 60 return false; |
61 | 61 |
62 int type = 0; | 62 int type = 0; |
63 if (command_name == values::kPageActionCommandEvent) { | 63 if (command_name == values::kPageActionCommandEvent) { |
64 type = chrome::NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC; | 64 type = extensions::NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC; |
65 } else if (command_name == values::kBrowserActionCommandEvent) { | 65 } else if (command_name == values::kBrowserActionCommandEvent) { |
66 type = chrome::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC; | 66 type = extensions::NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC; |
67 } else { | 67 } else { |
68 // Not handled by using notifications. Route it through the Browser Event | 68 // Not handled by using notifications. Route it through the Browser Event |
69 // Router using the base class (it will iterate through all targets). | 69 // Router using the base class (it will iterate through all targets). |
70 return ExtensionKeybindingRegistry::NotifyEventTargets(accelerator); | 70 return ExtensionKeybindingRegistry::NotifyEventTargets(accelerator); |
71 } | 71 } |
72 | 72 |
73 // Type != named command, so we need to dispatch this event directly. | 73 // Type != named command, so we need to dispatch this event directly. |
74 std::pair<const std::string, gfx::NativeWindow> details = | 74 std::pair<const std::string, gfx::NativeWindow> details = |
75 std::make_pair(extension_id, window_); | 75 std::make_pair(extension_id, window_); |
76 content::NotificationService::current()->Notify( | 76 content::NotificationService::current()->Notify( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 AddEventTarget(page_action.accelerator(), | 127 AddEventTarget(page_action.accelerator(), |
128 extension->id(), | 128 extension->id(), |
129 page_action.command_name()); | 129 page_action.command_name()); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 void ExtensionKeybindingRegistryCocoa::RemoveExtensionKeybindingImpl( | 133 void ExtensionKeybindingRegistryCocoa::RemoveExtensionKeybindingImpl( |
134 const ui::Accelerator& accelerator, | 134 const ui::Accelerator& accelerator, |
135 const std::string& command_name) { | 135 const std::string& command_name) { |
136 } | 136 } |
OLD | NEW |