[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 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 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" |
tfarina | 655f81d | 2014-12-23 02:38:50 | [diff] [blame] | 11 | #include "ui/gfx/geometry/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: | ||||
xjz | 694b50a9 | 2016-06-07 21:49:37 | [diff] [blame^] | 34 | // RenderViewObserver implementation. |
35 | void OnDestruct() override; | ||||
36 | |||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 37 | // Returns the WebView of the RenderView. |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 38 | blink::WebView* webview(); |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 39 | |
40 | // IPC Message handlers: | ||||
[email protected] | 6623d87 | 2014-03-18 17:43:13 | [diff] [blame] | 41 | void OnStringAtPoint(gfx::Point point); |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 42 | void OnCharacterIndexForPoint(gfx::Point point); |
[email protected] | db4fc1e | 2013-09-06 20:01:51 | [diff] [blame] | 43 | void OnFirstRectForCharacterRange(gfx::Range range); |
44 | void OnStringForRange(gfx::Range range); | ||||
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 45 | |
pkasting | 10cf76e | 2016-05-19 18:10:37 | [diff] [blame] | 46 | #if defined(ENABLE_PLUGINS) |
[email protected] | b25b3ee | 2012-01-13 05:19:54 | [diff] [blame] | 47 | RenderViewImpl* const render_view_impl_; |
pkasting | 10cf76e | 2016-05-19 18:10:37 | [diff] [blame] | 48 | #endif |
[email protected] | b25b3ee | 2012-01-13 05:19:54 | [diff] [blame] | 49 | |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 50 | DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); |
51 | }; | ||||
52 | |||||
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 53 | } // namespace content |
54 | |||||
[email protected] | 86a7d3c | 2011-09-12 16:45:32 | [diff] [blame] | 55 | #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |