| 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 28 matching lines...) Expand all Loading... |
| 39 class SpellCheckObserver : public content::WebContentsObserver { | 39 class SpellCheckObserver : public content::WebContentsObserver { |
| 40 public: | 40 public: |
| 41 SpellCheckObserver( | 41 SpellCheckObserver( |
| 42 RenderViewHost* host, | 42 RenderViewHost* host, |
| 43 ChromeRenderWidgetHostViewMacDelegate* view_delegate) | 43 ChromeRenderWidgetHostViewMacDelegate* view_delegate) |
| 44 : content::WebContentsObserver( | 44 : content::WebContentsObserver( |
| 45 content::WebContents::FromRenderViewHost(host)), | 45 content::WebContents::FromRenderViewHost(host)), |
| 46 view_delegate_(view_delegate) { | 46 view_delegate_(view_delegate) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual ~SpellCheckObserver() { | 49 ~SpellCheckObserver() override {} |
| 50 } | |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 virtual bool OnMessageReceived(const IPC::Message& message) override { | 52 bool OnMessageReceived(const IPC::Message& message) override { |
| 54 bool handled = true; | 53 bool handled = true; |
| 55 IPC_BEGIN_MESSAGE_MAP(SpellCheckObserver, message) | 54 IPC_BEGIN_MESSAGE_MAP(SpellCheckObserver, message) |
| 56 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ToggleSpellCheck, | 55 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ToggleSpellCheck, |
| 57 OnToggleSpellCheck) | 56 OnToggleSpellCheck) |
| 58 IPC_MESSAGE_UNHANDLED(handled = false) | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
| 59 IPC_END_MESSAGE_MAP() | 58 IPC_END_MESSAGE_MAP() |
| 60 return handled; | 59 return handled; |
| 61 } | 60 } |
| 62 | 61 |
| 63 void OnToggleSpellCheck(bool enabled, bool checked) { | 62 void OnToggleSpellCheck(bool enabled, bool checked) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 } | 246 } |
| 248 | 247 |
| 249 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { | 248 - (void)spellCheckEnabled:(BOOL)enabled checked:(BOOL)checked { |
| 250 spellcheckEnabled_ = enabled; | 249 spellcheckEnabled_ = enabled; |
| 251 spellcheckChecked_ = checked; | 250 spellcheckChecked_ = checked; |
| 252 } | 251 } |
| 253 | 252 |
| 254 // END Spellchecking methods | 253 // END Spellchecking methods |
| 255 | 254 |
| 256 @end | 255 @end |
| OLD | NEW |