| 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/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 void BrowserWindowCocoa::ShowAppMenu() { | 572 void BrowserWindowCocoa::ShowAppMenu() { |
| 573 // No-op. Mac doesn't support showing the menus via alt keys. | 573 // No-op. Mac doesn't support showing the menus via alt keys. |
| 574 } | 574 } |
| 575 | 575 |
| 576 bool BrowserWindowCocoa::PreHandleKeyboardEvent( | 576 bool BrowserWindowCocoa::PreHandleKeyboardEvent( |
| 577 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 577 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
| 578 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 578 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
| 579 return false; | 579 return false; |
| 580 | 580 |
| 581 if (event.type == blink::WebInputEvent::RawKeyDown && | 581 if (event.type == blink::WebInputEvent::RawKeyDown && |
| 582 [controller_ handledByExtensionCommand:event.os_event]) | 582 [controller_ |
| 583 handledByExtensionCommand:event.os_event |
| 584 priority:ui::AcceleratorManager::kHighPriority]) |
| 583 return true; | 585 return true; |
| 584 | 586 |
| 585 int id = [BrowserWindowUtils getCommandId:event]; | 587 int id = [BrowserWindowUtils getCommandId:event]; |
| 586 if (id == -1) | 588 if (id == -1) |
| 587 return false; | 589 return false; |
| 588 | 590 |
| 589 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { | 591 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { |
| 590 return [BrowserWindowUtils handleKeyboardEvent:event.os_event | 592 return [BrowserWindowUtils handleKeyboardEvent:event.os_event |
| 591 inWindow:window()]; | 593 inWindow:window()]; |
| 592 } | 594 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 757 |
| 756 void BrowserWindowCocoa::ShowPageActionPopup( | 758 void BrowserWindowCocoa::ShowPageActionPopup( |
| 757 const extensions::Extension* extension) { | 759 const extensions::Extension* extension) { |
| 758 [cocoa_controller() activatePageAction:extension->id()]; | 760 [cocoa_controller() activatePageAction:extension->id()]; |
| 759 } | 761 } |
| 760 | 762 |
| 761 void BrowserWindowCocoa::ShowBrowserActionPopup( | 763 void BrowserWindowCocoa::ShowBrowserActionPopup( |
| 762 const extensions::Extension* extension) { | 764 const extensions::Extension* extension) { |
| 763 [cocoa_controller() activateBrowserAction:extension->id()]; | 765 [cocoa_controller() activateBrowserAction:extension->id()]; |
| 764 } | 766 } |
| OLD | NEW |