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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 void BrowserWindowCocoa::ShowAppMenu() { | 500 void BrowserWindowCocoa::ShowAppMenu() { |
501 // No-op. Mac doesn't support showing the menus via alt keys. | 501 // No-op. Mac doesn't support showing the menus via alt keys. |
502 } | 502 } |
503 | 503 |
504 bool BrowserWindowCocoa::PreHandleKeyboardEvent( | 504 bool BrowserWindowCocoa::PreHandleKeyboardEvent( |
505 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 505 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
506 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 506 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
507 return false; | 507 return false; |
508 | 508 |
| 509 if (event.type == WebKit::WebInputEvent::RawKeyDown && |
| 510 [controller_ HandledByExtensionCommand:event.os_event]) |
| 511 return true; |
| 512 |
509 int id = [BrowserWindowUtils getCommandId:event]; | 513 int id = [BrowserWindowUtils getCommandId:event]; |
510 if (id == -1) | 514 if (id == -1) |
511 return false; | 515 return false; |
512 | 516 |
513 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { | 517 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { |
514 return [BrowserWindowUtils handleKeyboardEvent:event.os_event | 518 return [BrowserWindowUtils handleKeyboardEvent:event.os_event |
515 inWindow:window()]; | 519 inWindow:window()]; |
516 } | 520 } |
517 | 521 |
518 DCHECK(is_keyboard_shortcut); | 522 DCHECK(is_keyboard_shortcut); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 AvatarMenuBubbleController* menu = | 645 AvatarMenuBubbleController* menu = |
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 646 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
643 anchoredAt:point]; | 647 anchoredAt:point]; |
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 648 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
645 [menu showWindow:nil]; | 649 [menu showWindow:nil]; |
646 } | 650 } |
647 | 651 |
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 652 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
649 [[controller_ avatarButtonController] showAvatarBubble]; | 653 [[controller_ avatarButtonController] showAvatarBubble]; |
650 } | 654 } |
OLD | NEW |