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/macros.h" | 8 #include "base/macros.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/gfx/geometry/point.h" | 11 #include "ui/gfx/geometry/point.h" |
12 #include "ui/gfx/range/range.h" | 12 #include "ui/gfx/range/range.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 class WebView; | 15 class WebView; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class RenderViewImpl; | 20 class RenderFrameImpl; |
21 class RenderWidget; | |
21 | 22 |
22 // This is the renderer-side message filter that generates the replies for the | 23 // This is the renderer-side message filter that generates the replies for the |
23 // messages sent by the TextInputClientMac. See | 24 // messages sent by the TextInputClientMac. See |
24 // content/browser/renderer_host/text_input_client_mac.h for more information. | 25 // content/browser/renderer_host/text_input_client_mac.h for more information. |
25 class TextInputClientObserver : public RenderViewObserver { | 26 class TextInputClientObserver : public IPC::Listener, public IPC::Sender { |
26 public: | 27 public: |
27 explicit TextInputClientObserver(RenderViewImpl* render_view); | 28 explicit TextInputClientObserver(RenderFrameImpl* render_frame); |
28 ~TextInputClientObserver() override; | 29 ~TextInputClientObserver() override; |
29 | 30 |
30 // RenderViewObserver overrides: | 31 // RenderViewObserver overrides: |
Charlie Reis
2016/09/02 21:57:47
Stale comment. (These now override from somewhere
EhsanK
2016/09/08 17:10:40
Done.
| |
31 bool OnMessageReceived(const IPC::Message& message) override; | 32 bool OnMessageReceived(const IPC::Message& message) override; |
32 | 33 |
34 bool Send(IPC::Message* message) override; | |
35 | |
33 private: | 36 private: |
34 // RenderViewObserver implementation. | 37 // The render widget corresponding to the local root. |
Charlie Reis
2016/09/02 21:57:47
This confuses me a bit. "Local root" refers to a
EhsanK
2016/09/08 17:10:40
Acknowledged. I think I meant the RenderFramImpl w
| |
35 void OnDestruct() override; | 38 RenderWidget* GetRenderWidget(); |
36 | 39 |
37 // Returns the WebView of the RenderView. | 40 // Returns the WebView of the RenderView. |
Charlie Reis
2016/09/02 21:57:48
Should this still mention RenderView?
EhsanK
2016/09/08 17:10:40
No I don't think it should.
| |
38 blink::WebView* webview(); | 41 blink::WebView* GetWebView(); |
42 | |
43 // The routing ID of the RenderWidget. | |
44 int32_t GetRoutingID(); | |
39 | 45 |
40 // IPC Message handlers: | 46 // IPC Message handlers: |
41 void OnStringAtPoint(gfx::Point point); | 47 void OnStringAtPoint(gfx::Point point); |
42 void OnCharacterIndexForPoint(gfx::Point point); | 48 void OnCharacterIndexForPoint(gfx::Point point); |
43 void OnFirstRectForCharacterRange(gfx::Range range); | 49 void OnFirstRectForCharacterRange(gfx::Range range); |
44 void OnStringForRange(gfx::Range range); | 50 void OnStringForRange(gfx::Range range); |
45 | 51 |
46 #if defined(ENABLE_PLUGINS) | 52 // RenderFrameImpl owning this instance of the observer. |
47 RenderViewImpl* const render_view_impl_; | 53 RenderFrameImpl* render_frame_; |
48 #endif | |
49 | 54 |
50 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); | 55 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); |
51 }; | 56 }; |
52 | 57 |
53 } // namespace content | 58 } // namespace content |
54 | 59 |
55 #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ | 60 #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
OLD | NEW |