OLD | NEW |
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/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/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/debugger/devtools_window.h" | 10 #include "chrome/browser/debugger/devtools_window.h" |
11 #include "chrome/browser/spellchecker/spellchecker_platform_engine.h" | 11 #include "chrome/browser/spellchecker/spellchecker_mac.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
14 #import "chrome/browser/ui/cocoa/history_overlay_controller.h" | 14 #import "chrome/browser/ui/cocoa/history_overlay_controller.h" |
15 #import "chrome/browser/ui/cocoa/view_id_util.h" | 15 #import "chrome/browser/ui/cocoa/view_id_util.h" |
16 #include "chrome/common/spellcheck_messages.h" | 16 #include "chrome/common/spellcheck_messages.h" |
17 #include "content/browser/mac/closure_blocks_leopard_compat.h" | 17 #include "content/browser/mac/closure_blocks_leopard_compat.h" |
18 #include "content/browser/renderer_host/render_view_host.h" | 18 #include "content/browser/renderer_host/render_view_host.h" |
19 #include "content/browser/renderer_host/render_widget_host.h" | 19 #include "content/browser/renderer_host/render_widget_host.h" |
20 #include "content/browser/renderer_host/render_widget_host_view.h" | 20 #include "content/browser/renderer_host/render_widget_host_view.h" |
21 #include "content/public/browser/render_view_host_observer.h" | 21 #include "content/public/browser/render_view_host_observer.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // This is also called from the Edit -> Spelling -> Check Spelling menu item. | 302 // This is also called from the Edit -> Spelling -> Check Spelling menu item. |
303 - (void)checkSpelling:(id)sender { | 303 - (void)checkSpelling:(id)sender { |
304 render_widget_host_->Send(new SpellCheckMsg_AdvanceToNextMisspelling( | 304 render_widget_host_->Send(new SpellCheckMsg_AdvanceToNextMisspelling( |
305 render_widget_host_->routing_id())); | 305 render_widget_host_->routing_id())); |
306 } | 306 } |
307 | 307 |
308 // This message is sent by the spelling panel whenever a word is ignored. | 308 // This message is sent by the spelling panel whenever a word is ignored. |
309 - (void)ignoreSpelling:(id)sender { | 309 - (void)ignoreSpelling:(id)sender { |
310 // Ideally, we would ask the current RenderView for its tag, but that would | 310 // Ideally, we would ask the current RenderView for its tag, but that would |
311 // mean making a blocking IPC call from the browser. Instead, | 311 // mean making a blocking IPC call from the browser. Instead, |
312 // SpellCheckerPlatform::CheckSpelling remembers the last tag and | 312 // SpellCheckerMac::CheckSpelling remembers the last tag and |
313 // SpellCheckerPlatform::IgnoreWord assumes that is the correct tag. | 313 // SpellCheckerMac::IgnoreWord assumes that is the correct tag. |
314 NSString* wordToIgnore = [sender stringValue]; | 314 NSString* wordToIgnore = [sender stringValue]; |
315 if (wordToIgnore != nil) | 315 if (wordToIgnore != nil) |
316 SpellCheckerPlatform::IgnoreWord(base::SysNSStringToUTF16(wordToIgnore)); | 316 SpellCheckerMac::IgnoreWord(base::SysNSStringToUTF16(wordToIgnore)); |
317 } | 317 } |
318 | 318 |
319 - (void)showGuessPanel:(id)sender { | 319 - (void)showGuessPanel:(id)sender { |
320 render_widget_host_->Send(new SpellCheckMsg_ToggleSpellPanel( | 320 render_widget_host_->Send(new SpellCheckMsg_ToggleSpellPanel( |
321 render_widget_host_->routing_id(), | 321 render_widget_host_->routing_id(), |
322 SpellCheckerPlatform::SpellingPanelVisible())); | 322 SpellCheckerMac::SpellingPanelVisible())); |
323 } | 323 } |
324 | 324 |
325 - (void)toggleContinuousSpellChecking:(id)sender { | 325 - (void)toggleContinuousSpellChecking:(id)sender { |
326 render_widget_host_->Send( | 326 render_widget_host_->Send( |
327 new SpellCheckMsg_ToggleSpellCheck(render_widget_host_->routing_id())); | 327 new SpellCheckMsg_ToggleSpellCheck(render_widget_host_->routing_id())); |
328 } | 328 } |
329 | 329 |
330 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { | 330 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { |
331 spellcheck_enabled_ = enabled; | 331 spellcheck_enabled_ = enabled; |
332 spellcheck_checked_ = checked; | 332 spellcheck_checked_ = checked; |
333 } | 333 } |
334 | 334 |
335 // END Spellchecking methods | 335 // END Spellchecking methods |
336 | 336 |
337 @end | 337 @end |
OLD | NEW |