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" |
11 #include "chrome/browser/devtools/devtools_window.h" | 11 #include "chrome/browser/devtools/devtools_window.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" | 13 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" |
14 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" | 14 #include "chrome/browser/spellchecker/spellcheck_platform_mac.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
17 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
18 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 18 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 19 #import "chrome/browser/ui/cocoa/system_hotkey_helper_mac.h" |
| 20 #import "chrome/browser/ui/cocoa/system_hotkey_map.h" |
19 #import "chrome/browser/ui/cocoa/view_id_util.h" | 21 #import "chrome/browser/ui/cocoa/view_id_util.h" |
20 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
21 #include "chrome/common/spellcheck_messages.h" | 23 #include "chrome/common/spellcheck_messages.h" |
22 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
23 #include "content/public/browser/render_process_host.h" | 25 #include "content/public/browser/render_process_host.h" |
24 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
25 #include "content/public/browser/render_widget_host.h" | 27 #include "content/public/browser/render_widget_host.h" |
26 #include "content/public/browser/render_widget_host_view.h" | 28 #include "content/public/browser/render_widget_host_view.h" |
27 #include "content/public/browser/web_contents.h" | 29 #include "content/public/browser/web_contents.h" |
28 #include "content/public/browser/web_contents_observer.h" | 30 #include "content/public/browser/web_contents_observer.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 193 } |
192 | 194 |
193 return NO; | 195 return NO; |
194 } | 196 } |
195 | 197 |
196 - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event | 198 - (void)rendererHandledWheelEvent:(const blink::WebMouseWheelEvent&)event |
197 consumed:(BOOL)consumed { | 199 consumed:(BOOL)consumed { |
198 [historySwiper_ rendererHandledWheelEvent:event consumed:consumed]; | 200 [historySwiper_ rendererHandledWheelEvent:event consumed:consumed]; |
199 } | 201 } |
200 | 202 |
| 203 - (BOOL)eventIsReservedBySystem:(NSEvent*)event { |
| 204 SystemHotkeyHelperMac* helper = SystemHotkeyHelperMac::GetInstance(); |
| 205 return helper->map()->IsEventReserved(event); |
| 206 } |
| 207 |
201 // Spellchecking methods | 208 // Spellchecking methods |
202 // 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 |
203 // responder for anything in the browser. | 210 // responder for anything in the browser. |
204 | 211 |
205 // 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 |
206 // changed from the spellChecker. | 213 // changed from the spellChecker. |
207 - (void)changeSpelling:(id)sender { | 214 - (void)changeSpelling:(id)sender { |
208 // 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 |
209 // 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. |
210 NSString* newWord = [[sender selectedCell] stringValue]; | 217 NSString* newWord = [[sender selectedCell] stringValue]; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 262 } |
256 | 263 |
257 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { | 264 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { |
258 spellcheckEnabled_ = enabled; | 265 spellcheckEnabled_ = enabled; |
259 spellcheckChecked_ = checked; | 266 spellcheckChecked_ = checked; |
260 } | 267 } |
261 | 268 |
262 // END Spellchecking methods | 269 // END Spellchecking methods |
263 | 270 |
264 @end | 271 @end |
OLD | NEW |