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 #ifndef CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ | 5 #ifndef CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
6 #define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ | 6 #define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/public/renderer/render_view_observer.h" | 10 #include "content/public/renderer/render_view_observer.h" |
11 #include "ui/base/range/range.h" | |
12 #include "ui/gfx/point.h" | 11 #include "ui/gfx/point.h" |
| 12 #include "ui/gfx/range/range.h" |
13 | 13 |
14 namespace WebKit { | 14 namespace WebKit { |
15 class WebView; | 15 class WebView; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class RenderViewImpl; | 20 class RenderViewImpl; |
21 | 21 |
22 // This is the renderer-side message filter that generates the replies for the | 22 // This is the renderer-side message filter that generates the replies for the |
23 // messages sent by the TextInputClientMac. See | 23 // messages sent by the TextInputClientMac. See |
24 // content/browser/renderer_host/text_input_client_mac.h for more information. | 24 // content/browser/renderer_host/text_input_client_mac.h for more information. |
25 class TextInputClientObserver : public RenderViewObserver { | 25 class TextInputClientObserver : public RenderViewObserver { |
26 public: | 26 public: |
27 explicit TextInputClientObserver(RenderViewImpl* render_view); | 27 explicit TextInputClientObserver(RenderViewImpl* render_view); |
28 virtual ~TextInputClientObserver(); | 28 virtual ~TextInputClientObserver(); |
29 | 29 |
30 // RenderViewObserver overrides: | 30 // RenderViewObserver overrides: |
31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 // Returns the WebView of the RenderView. | 34 // Returns the WebView of the RenderView. |
35 WebKit::WebView* webview(); | 35 WebKit::WebView* webview(); |
36 | 36 |
37 // IPC Message handlers: | 37 // IPC Message handlers: |
38 void OnCharacterIndexForPoint(gfx::Point point); | 38 void OnCharacterIndexForPoint(gfx::Point point); |
39 void OnFirstRectForCharacterRange(ui::Range range); | 39 void OnFirstRectForCharacterRange(gfx::Range range); |
40 void OnStringForRange(ui::Range range); | 40 void OnStringForRange(gfx::Range range); |
41 | 41 |
42 RenderViewImpl* const render_view_impl_; | 42 RenderViewImpl* const render_view_impl_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); | 44 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace content | 47 } // namespace content |
48 | 48 |
49 #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ | 49 #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
OLD | NEW |