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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 564 |
565 void BrowserWindowCocoa::ShowAppMenu() { | 565 void BrowserWindowCocoa::ShowAppMenu() { |
566 // No-op. Mac doesn't support showing the menus via alt keys. | 566 // No-op. Mac doesn't support showing the menus via alt keys. |
567 } | 567 } |
568 | 568 |
569 bool BrowserWindowCocoa::PreHandleKeyboardEvent( | 569 bool BrowserWindowCocoa::PreHandleKeyboardEvent( |
570 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 570 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
571 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 571 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
572 return false; | 572 return false; |
573 | 573 |
574 if (event.type == WebKit::WebInputEvent::RawKeyDown && | 574 if (event.type == blink::WebInputEvent::RawKeyDown && |
575 [controller_ handledByExtensionCommand:event.os_event]) | 575 [controller_ handledByExtensionCommand:event.os_event]) |
576 return true; | 576 return true; |
577 | 577 |
578 int id = [BrowserWindowUtils getCommandId:event]; | 578 int id = [BrowserWindowUtils getCommandId:event]; |
579 if (id == -1) | 579 if (id == -1) |
580 return false; | 580 return false; |
581 | 581 |
582 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { | 582 if (browser_->command_controller()->IsReservedCommandOrKey(id, event)) { |
583 return [BrowserWindowUtils handleKeyboardEvent:event.os_event | 583 return [BrowserWindowUtils handleKeyboardEvent:event.os_event |
584 inWindow:window()]; | 584 inWindow:window()]; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 // further, both by another H, i.e. WebContentsView's height becomes | 758 // further, both by another H, i.e. WebContentsView's height becomes |
759 // A.height() + H and RenderWidgetHostView's height becomes A.height() + 2H. | 759 // A.height() + H and RenderWidgetHostView's height becomes A.height() + 2H. |
760 // Strangely, the RenderWidgetHostView for the previous navigation entry also | 760 // Strangely, the RenderWidgetHostView for the previous navigation entry also |
761 // gets enlarged by H. | 761 // gets enlarged by H. |
762 // I believe these "automatic" resizing are caused by setAutoresizingMask of | 762 // I believe these "automatic" resizing are caused by setAutoresizingMask of |
763 // of the cocoa view in WebContentsViewMac, which defeats the purpose of | 763 // of the cocoa view in WebContentsViewMac, which defeats the purpose of |
764 // WebContentsDelegate::GetSizeForNewRenderView i.e. to prevent resizing of | 764 // WebContentsDelegate::GetSizeForNewRenderView i.e. to prevent resizing of |
765 // RenderWidgetHostView in (2) and (3). | 765 // RenderWidgetHostView in (2) and (3). |
766 return 0; | 766 return 0; |
767 } | 767 } |
OLD | NEW |