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

Side by Side Diff: chrome/browser/cocoa/find_bar_cocoa_controller.mm

Issue 204006: [Mac] Make the pageup, Shift-pageup, and Option-Shift-pageup keys scroll the ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/mac_util.h" 8 #include "base/mac_util.h"
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 if (command == @selector(insertNewline:)) { 106 if (command == @selector(insertNewline:)) {
107 NSEvent* event = [NSApp currentEvent]; 107 NSEvent* event = [NSApp currentEvent];
108 108
109 if ([event modifierFlags] & NSShiftKeyMask) 109 if ([event modifierFlags] & NSShiftKeyMask)
110 [previousButton_ performClick:nil]; 110 [previousButton_ performClick:nil];
111 else { 111 else {
112 [nextButton_ performClick:nil]; 112 [nextButton_ performClick:nil];
113 } 113 }
114 114
115 return YES; 115 return YES;
116 } else if (command == @selector(pageUp:) ||
117 command == @selector(pageUpAndModifySelection:) ||
118 command == @selector(scrollPageUp:) ||
119 command == @selector(pageDown:) ||
120 command == @selector(pageDownAndModifySelection:) ||
121 command == @selector(scrollPageDown:)) {
122 TabContents* contents =
123 findBarBridge_->GetFindBarController()->tab_contents();
124 if (!contents)
125 return NO;
126
127 // Sanity-check to make sure we got a keyboard event.
128 NSEvent* event = [NSApp currentEvent];
129 if ([event type] != NSKeyDown && [event type] != NSKeyUp)
130 return NO;
131
132 // Forward the event to the renderer.
133 // TODO(rohitrao): Should this call -[BaseView keyEvent:]? Is there code in
134 // that function that we want to keep or avoid?
135 RenderViewHost* render_view_host = contents->render_view_host();
136 render_view_host->ForwardKeyboardEvent(NativeWebKeyboardEvent(event));
137 return YES;
116 } 138 }
117 139
118 return NO; 140 return NO;
119 } 141 }
120 142
121 // Methods from FindBar 143 // Methods from FindBar
122 - (void)showFindBar { 144 - (void)showFindBar {
123 [[self view] setHidden:NO]; 145 [[self view] setHidden:NO];
124 146
125 // Save the currently-focused view. |[self view]| is in the view 147 // Save the currently-focused view. |[self view]| is in the view
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 233
212 // TODO(rohitrao): If the search string is too long, then it will overlap with 234 // TODO(rohitrao): If the search string is too long, then it will overlap with
213 // the results label. Fix. 235 // the results label. Fix.
214 } 236 }
215 237
216 - (BOOL)isFindBarVisible { 238 - (BOOL)isFindBarVisible {
217 return [[self view] isHidden] ? NO : YES; 239 return [[self view] isHidden] ? NO : YES;
218 } 240 }
219 241
220 @end 242 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698