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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 *is_keyboard_shortcut = true; | 726 *is_keyboard_shortcut = true; |
727 return false; | 727 return false; |
728 } | 728 } |
729 | 729 |
730 void BrowserWindowCocoa::HandleKeyboardEvent( | 730 void BrowserWindowCocoa::HandleKeyboardEvent( |
731 const NativeWebKeyboardEvent& event) { | 731 const NativeWebKeyboardEvent& event) { |
732 if ([BrowserWindowUtils shouldHandleKeyboardEvent:event]) | 732 if ([BrowserWindowUtils shouldHandleKeyboardEvent:event]) |
733 [BrowserWindowUtils handleKeyboardEvent:event.os_event inWindow:window()]; | 733 [BrowserWindowUtils handleKeyboardEvent:event.os_event inWindow:window()]; |
734 } | 734 } |
735 | 735 |
736 void BrowserWindowCocoa::Cut() { | 736 void BrowserWindowCocoa::CutCopyPaste(int command_id) { |
737 [NSApp sendAction:@selector(cut:) to:nil from:nil]; | 737 if (command_id == IDC_CUT) |
738 } | 738 [NSApp sendAction:@selector(cut:) to:nil from:nil]; |
739 | 739 else if (command_id == IDC_COPY) |
740 void BrowserWindowCocoa::Copy() { | 740 [NSApp sendAction:@selector(copy:) to:nil from:nil]; |
741 [NSApp sendAction:@selector(copy:) to:nil from:nil]; | 741 else |
742 } | 742 [NSApp sendAction:@selector(paste:) to:nil from:nil]; |
743 | |
744 void BrowserWindowCocoa::Paste() { | |
745 [NSApp sendAction:@selector(paste:) to:nil from:nil]; | |
746 } | 743 } |
747 | 744 |
748 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds( | 745 WindowOpenDisposition BrowserWindowCocoa::GetDispositionForPopupBounds( |
749 const gfx::Rect& bounds) { | 746 const gfx::Rect& bounds) { |
750 // When using Cocoa's System Fullscreen mode, convert popups into tabs. | 747 // When using Cocoa's System Fullscreen mode, convert popups into tabs. |
751 if ([controller_ isInAppKitFullscreen]) | 748 if ([controller_ isInAppKitFullscreen]) |
752 return NEW_FOREGROUND_TAB; | 749 return NEW_FOREGROUND_TAB; |
753 return NEW_POPUP; | 750 return NEW_POPUP; |
754 } | 751 } |
755 | 752 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 void BrowserWindowCocoa::UnhideDownloadShelf() { | 831 void BrowserWindowCocoa::UnhideDownloadShelf() { |
835 GetDownloadShelf()->Unhide(); | 832 GetDownloadShelf()->Unhide(); |
836 } | 833 } |
837 | 834 |
838 void BrowserWindowCocoa::HideDownloadShelf() { | 835 void BrowserWindowCocoa::HideDownloadShelf() { |
839 GetDownloadShelf()->Hide(); | 836 GetDownloadShelf()->Hide(); |
840 StatusBubble* statusBubble = GetStatusBubble(); | 837 StatusBubble* statusBubble = GetStatusBubble(); |
841 if (statusBubble) | 838 if (statusBubble) |
842 statusBubble->Hide(); | 839 statusBubble->Hide(); |
843 } | 840 } |
OLD | NEW |