Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 388313002: mac: Allow WebContents key handling to supplant extension overrides of the bookmark shortcut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from yoz and shess. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698