[email protected] | b25b3ee | 2012-01-13 05:19:54 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 86a7d3c | 2011-09-12 16:45:32 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
6 | #define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ | ||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 7 | |
8 | #include "base/basictypes.h" | ||||
9 | #include "build/build_config.h" | ||||
[email protected] | 3a034ebb | 2011-10-03 19:19:44 | [diff] [blame] | 10 | #include "content/public/renderer/render_view_observer.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 11 | #include "ui/gfx/point.h" |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 12 | #include "ui/gfx/range/range.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 13 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 14 | namespace blink { |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 15 | class WebView; |
16 | } | ||||
17 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 18 | namespace content { |
19 | |||||
20 | class RenderViewImpl; | ||||
21 | |||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 22 | // This is the renderer-side message filter that generates the replies for the |
23 | // messages sent by the TextInputClientMac. See | ||||
[email protected] | 86a7d3c | 2011-09-12 16:45:32 | [diff] [blame] | 24 | // content/browser/renderer_host/text_input_client_mac.h for more information. |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 25 | class TextInputClientObserver : public RenderViewObserver { |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 26 | public: |
[email protected] | 310ebd630 | 2011-10-10 19:06:28 | [diff] [blame] | 27 | explicit TextInputClientObserver(RenderViewImpl* render_view); |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame^] | 28 | ~TextInputClientObserver() override; |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 29 | |
30 | // RenderViewObserver overrides: | ||||
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame^] | 31 | bool OnMessageReceived(const IPC::Message& message) override; |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 32 | |
33 | private: | ||||
34 | // Returns the WebView of the RenderView. | ||||
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 35 | blink::WebView* webview(); |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 36 | |
37 | // IPC Message handlers: | ||||
[email protected] | 6623d87 | 2014-03-18 17:43:13 | [diff] [blame] | 38 | void OnStringAtPoint(gfx::Point point); |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 39 | void OnCharacterIndexForPoint(gfx::Point point); |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 40 | void OnFirstRectForCharacterRange(gfx::Range range); |
41 | void OnStringForRange(gfx::Range range); | ||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 42 | |
[email protected] | b25b3ee | 2012-01-13 05:19:54 | [diff] [blame] | 43 | RenderViewImpl* const render_view_impl_; |
44 | |||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 45 | DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); |
46 | }; | ||||
47 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 48 | } // namespace content |
49 | |||||
[email protected] | 86a7d3c | 2011-09-12 16:45:32 | [diff] [blame] | 50 | #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |