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

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

Issue 1250533003: [Mac] Remove BrowserCommandExecutor protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/browser_window_utils.h" 5 #import "chrome/browser/ui/cocoa/browser_window_utils.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 27 matching lines...) Expand all
38 if ([event type] == NSKeyDown) { 38 if ([event type] == NSKeyDown) {
39 // Send the event to the menu before sending it to the browser/window 39 // Send the event to the menu before sending it to the browser/window
40 // shortcut handling, so that if a user configures cmd-left to mean 40 // shortcut handling, so that if a user configures cmd-left to mean
41 // "previous tab", it takes precedence over the built-in "history back" 41 // "previous tab", it takes precedence over the built-in "history back"
42 // binding. Other than that, the |-redispatchKeyEvent:| call would take care 42 // binding. Other than that, the |-redispatchKeyEvent:| call would take care
43 // of invoking the original menu item shortcut as well. 43 // of invoking the original menu item shortcut as well.
44 44
45 if ([[NSApp mainMenu] performKeyEquivalent:event]) 45 if ([[NSApp mainMenu] performKeyEquivalent:event])
46 return true; 46 return true;
47 47
48 if ([event_window handleExtraBrowserKeyboardShortcut:event]) 48 if ([event_window handleExtraKeyboardShortcut:event])
49 return true;
50
51 if ([event_window handleExtraWindowKeyboardShortcut:event])
52 return true;
53
54 if ([event_window handleDelayedWindowKeyboardShortcut:event])
55 return true; 49 return true;
56 } 50 }
57 51
58 return [event_window redispatchKeyEvent:event]; 52 return [event_window redispatchKeyEvent:event];
59 } 53 }
60 54
61 + (NSString*)scheduleReplaceOldTitle:(NSString*)oldTitle 55 + (NSString*)scheduleReplaceOldTitle:(NSString*)oldTitle
62 withNewTitle:(NSString*)newTitle 56 withNewTitle:(NSString*)newTitle
63 forWindow:(NSWindow*)window { 57 forWindow:(NSWindow*)window {
64 if (oldTitle) 58 if (oldTitle)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 + (void)activateWindowForController:(NSWindowController*)controller { 126 + (void)activateWindowForController:(NSWindowController*)controller {
133 // Per http://crbug.com/73779 and http://crbug.com/75223, we need this to 127 // Per http://crbug.com/73779 and http://crbug.com/75223, we need this to
134 // properly activate windows if Chrome is not the active application. 128 // properly activate windows if Chrome is not the active application.
135 [[controller window] makeKeyAndOrderFront:controller]; 129 [[controller window] makeKeyAndOrderFront:controller];
136 ProcessSerialNumber psn; 130 ProcessSerialNumber psn;
137 GetCurrentProcess(&psn); 131 GetCurrentProcess(&psn);
138 SetFrontProcessWithOptions(&psn, kSetFrontProcessFrontWindowOnly); 132 SetFrontProcessWithOptions(&psn, kSetFrontProcessFrontWindowOnly);
139 } 133 }
140 134
141 @end 135 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/chrome_event_processing_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698