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

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

Issue 1091703002: Eliminate faux-RTTI code from BrowserView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to patch set 2 Created 5 years, 8 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 #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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698