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 #include <QuartzCore/QuartzCore.h> | 5 #include <QuartzCore/QuartzCore.h> |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 class SpellCheckRenderViewObserver : public RenderViewHostObserver { | 194 class SpellCheckRenderViewObserver : public RenderViewHostObserver { |
195 public: | 195 public: |
196 SpellCheckRenderViewObserver(RenderViewHost* host, | 196 SpellCheckRenderViewObserver(RenderViewHost* host, |
197 RenderWidgetHostViewMac* view) | 197 RenderWidgetHostViewMac* view) |
198 : RenderViewHostObserver(host), | 198 : RenderViewHostObserver(host), |
199 view_(view) { | 199 view_(view) { |
200 } | 200 } |
201 | 201 |
202 private: | 202 private: |
203 // RenderViewHostObserver implementation. | 203 // RenderViewHostObserver implementation. |
204 virtual bool OnMessageReceived(const IPC::Message& message) { | 204 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { |
205 bool handled = true; | 205 bool handled = true; |
206 IPC_BEGIN_MESSAGE_MAP(SpellCheckRenderViewObserver, message) | 206 IPC_BEGIN_MESSAGE_MAP(SpellCheckRenderViewObserver, message) |
207 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ToggleSpellCheck, | 207 IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ToggleSpellCheck, |
208 OnToggleSpellCheck) | 208 OnToggleSpellCheck) |
209 IPC_MESSAGE_UNHANDLED(handled = false) | 209 IPC_MESSAGE_UNHANDLED(handled = false) |
210 IPC_END_MESSAGE_MAP() | 210 IPC_END_MESSAGE_MAP() |
211 return handled; | 211 return handled; |
212 } | 212 } |
213 | 213 |
214 void OnToggleSpellCheck(bool enabled, bool checked) { | 214 void OnToggleSpellCheck(bool enabled, bool checked) { |
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 if (!string) return NO; | 2756 if (!string) return NO; |
2757 | 2757 |
2758 // If the user is currently using an IME, confirm the IME input, | 2758 // If the user is currently using an IME, confirm the IME input, |
2759 // and then insert the text from the service, the same as TextEdit and Safari. | 2759 // and then insert the text from the service, the same as TextEdit and Safari. |
2760 [self confirmComposition]; | 2760 [self confirmComposition]; |
2761 [self insertText:string]; | 2761 [self insertText:string]; |
2762 return YES; | 2762 return YES; |
2763 } | 2763 } |
2764 | 2764 |
2765 @end | 2765 @end |
OLD | NEW |