| 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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 704 |
| 705 void BrowserWindowCocoa::ShowAppMenu() { | 705 void BrowserWindowCocoa::ShowAppMenu() { |
| 706 // No-op. Mac doesn't support showing the menus via alt keys. | 706 // No-op. Mac doesn't support showing the menus via alt keys. |
| 707 } | 707 } |
| 708 | 708 |
| 709 bool BrowserWindowCocoa::PreHandleKeyboardEvent( | 709 bool BrowserWindowCocoa::PreHandleKeyboardEvent( |
| 710 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 710 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
| 711 // Handle ESC to dismiss permission bubbles, but still forward it | 711 // Handle ESC to dismiss permission bubbles, but still forward it |
| 712 // to the window afterwards. | 712 // to the window afterwards. |
| 713 if (event.windowsKeyCode == ui::VKEY_ESCAPE) | 713 if (event.windowsKeyCode == ui::VKEY_ESCAPE) |
| 714 [controller_ dismissPermissionBubble]; | 714 [controller_ dismissBubble]; |
| 715 | 715 |
| 716 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 716 if (![BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
| 717 return false; | 717 return false; |
| 718 | 718 |
| 719 if (event.type == blink::WebInputEvent::RawKeyDown && | 719 if (event.type == blink::WebInputEvent::RawKeyDown && |
| 720 [controller_ | 720 [controller_ |
| 721 handledByExtensionCommand:event.os_event | 721 handledByExtensionCommand:event.os_event |
| 722 priority:ui::AcceleratorManager::kHighPriority]) | 722 priority:ui::AcceleratorManager::kHighPriority]) |
| 723 return true; | 723 return true; |
| 724 | 724 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 void BrowserWindowCocoa::UnhideDownloadShelf() { | 845 void BrowserWindowCocoa::UnhideDownloadShelf() { |
| 846 GetDownloadShelf()->Unhide(); | 846 GetDownloadShelf()->Unhide(); |
| 847 } | 847 } |
| 848 | 848 |
| 849 void BrowserWindowCocoa::HideDownloadShelf() { | 849 void BrowserWindowCocoa::HideDownloadShelf() { |
| 850 GetDownloadShelf()->Hide(); | 850 GetDownloadShelf()->Hide(); |
| 851 StatusBubble* statusBubble = GetStatusBubble(); | 851 StatusBubble* statusBubble = GetStatusBubble(); |
| 852 if (statusBubble) | 852 if (statusBubble) |
| 853 statusBubble->Hide(); | 853 statusBubble->Hide(); |
| 854 } | 854 } |
| OLD | NEW |