| 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 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" | 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 view_id_util::UnsetID(view); | 99 view_id_util::UnsetID(view); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Handle an event. All incoming key and mouse events flow through this | 102 // Handle an event. All incoming key and mouse events flow through this |
| 103 // delegate method if implemented. Return YES if the event is fully handled, or | 103 // delegate method if implemented. Return YES if the event is fully handled, or |
| 104 // NO if normal processing should take place. | 104 // NO if normal processing should take place. |
| 105 - (BOOL)handleEvent:(NSEvent*)event { | 105 - (BOOL)handleEvent:(NSEvent*)event { |
| 106 return [historySwiper_ handleEvent:event]; | 106 return [historySwiper_ handleEvent:event]; |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Notification that a wheel event was unhandled. | |
| 110 - (void)gotUnhandledWheelEvent { | |
| 111 [historySwiper_ gotUnhandledWheelEvent]; | |
| 112 } | |
| 113 | |
| 114 // Notification of scroll offset pinning. | 109 // Notification of scroll offset pinning. |
| 115 - (void)scrollOffsetPinnedToLeft:(BOOL)left toRight:(BOOL)right { | 110 - (void)scrollOffsetPinnedToLeft:(BOOL)left toRight:(BOOL)right { |
| 116 [historySwiper_ scrollOffsetPinnedToLeft:left toRight:right]; | |
| 117 } | 111 } |
| 118 | 112 |
| 119 // Notification of whether the view has a horizontal scrollbar. | 113 // Notification of whether the view has a horizontal scrollbar. |
| 120 - (void)setHasHorizontalScrollbar:(BOOL)has_horizontal_scrollbar { | 114 - (void)setHasHorizontalScrollbar:(BOOL)has_horizontal_scrollbar { |
| 121 [historySwiper_ setHasHorizontalScrollbar:has_horizontal_scrollbar]; | |
| 122 } | 115 } |
| 123 | 116 |
| 124 // NSWindow events. | 117 // NSWindow events. |
| 125 | 118 |
| 126 - (void)beginGestureWithEvent:(NSEvent*)event { | 119 - (void)beginGestureWithEvent:(NSEvent*)event { |
| 127 [historySwiper_ beginGestureWithEvent:event]; | 120 [historySwiper_ beginGestureWithEvent:event]; |
| 128 } | 121 } |
| 129 | 122 |
| 130 - (void)endGestureWithEvent:(NSEvent*)event { | 123 - (void)endGestureWithEvent:(NSEvent*)event { |
| 131 [historySwiper_ endGestureWithEvent:event]; | 124 [historySwiper_ endGestureWithEvent:event]; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 spellcheckChecked_ ? NSOnState : NSOffState; | 193 spellcheckChecked_ ? NSOnState : NSOffState; |
| 201 [(id)item setState:checkedState]; | 194 [(id)item setState:checkedState]; |
| 202 } | 195 } |
| 203 *valid = spellcheckEnabled_; | 196 *valid = spellcheckEnabled_; |
| 204 return YES; | 197 return YES; |
| 205 } | 198 } |
| 206 | 199 |
| 207 return NO; | 200 return NO; |
| 208 } | 201 } |
| 209 | 202 |
| 203 - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event |
| 204 consumed:(BOOL)consumed { |
| 205 [historySwiper_ rendererHandledWheelEvent:event consumed:consumed]; |
| 206 } |
| 207 |
| 210 // Spellchecking methods | 208 // Spellchecking methods |
| 211 // The next five methods are implemented here since this class is the first | 209 // The next five methods are implemented here since this class is the first |
| 212 // responder for anything in the browser. | 210 // responder for anything in the browser. |
| 213 | 211 |
| 214 // This message is sent whenever the user specifies that a word should be | 212 // This message is sent whenever the user specifies that a word should be |
| 215 // changed from the spellChecker. | 213 // changed from the spellChecker. |
| 216 - (void)changeSpelling:(id)sender { | 214 - (void)changeSpelling:(id)sender { |
| 217 // Grab the currently selected word from the spell panel, as this is the word | 215 // Grab the currently selected word from the spell panel, as this is the word |
| 218 // that we want to replace the selected word in the text with. | 216 // that we want to replace the selected word in the text with. |
| 219 NSString* newWord = [[sender selectedCell] stringValue]; | 217 NSString* newWord = [[sender selectedCell] stringValue]; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 262 } |
| 265 | 263 |
| 266 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { | 264 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { |
| 267 spellcheckEnabled_ = enabled; | 265 spellcheckEnabled_ = enabled; |
| 268 spellcheckChecked_ = checked; | 266 spellcheckChecked_ = checked; |
| 269 } | 267 } |
| 270 | 268 |
| 271 // END Spellchecking methods | 269 // END Spellchecking methods |
| 272 | 270 |
| 273 @end | 271 @end |
| OLD | NEW |