Chromium Code Reviews| Index: content/renderer/text_input_client_observer.h |
| diff --git a/content/renderer/text_input_client_observer.h b/content/renderer/text_input_client_observer.h |
| index 2c538a61c2b9813b18ae21cbb734c1d0f96bf773..f8c9a6a8468a2f3ec6a49f3aff7b0a2cb740eb92 100644 |
| --- a/content/renderer/text_input_client_observer.h |
| +++ b/content/renderer/text_input_client_observer.h |
| @@ -6,6 +6,7 @@ |
| #define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_ |
| #include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| #include "build/build_config.h" |
| #include "content/public/renderer/render_view_observer.h" |
| #include "ui/gfx/geometry/point.h" |
| @@ -17,35 +18,45 @@ class WebView; |
| namespace content { |
| -class RenderViewImpl; |
| +class RenderWidget; |
| // This is the renderer-side message filter that generates the replies for the |
| // messages sent by the TextInputClientMac. See |
| // content/browser/renderer_host/text_input_client_mac.h for more information. |
| -class TextInputClientObserver : public RenderViewObserver { |
| +class TextInputClientObserver : public IPC::Listener, public IPC::Sender { |
| public: |
| - explicit TextInputClientObserver(RenderViewImpl* render_view); |
| + TextInputClientObserver(scoped_refptr<RenderWidget> render_widget, |
| + blink::WebView* webv_iew); |
|
erikchen
2016/09/01 00:04:29
s/webv_iew/web_view
EhsanK
2016/09/01 21:58:37
Thanks. Changed the constructors signature and thi
|
| ~TextInputClientObserver() override; |
| // RenderViewObserver overrides: |
| bool OnMessageReceived(const IPC::Message& message) override; |
| - private: |
| - // RenderViewObserver implementation. |
| - void OnDestruct() override; |
| + bool Send(IPC::Message* message) override; |
| + |
| + const RenderWidget* render_widget() const { return render_widget_.get(); } |
| + private: |
| // Returns the WebView of the RenderView. |
| blink::WebView* webview(); |
| + int32_t GetRoutingID(); |
| + |
| // IPC Message handlers: |
| void OnStringAtPoint(gfx::Point point); |
| void OnCharacterIndexForPoint(gfx::Point point); |
| void OnFirstRectForCharacterRange(gfx::Range range); |
| void OnStringForRange(gfx::Range range); |
| -#if defined(ENABLE_PLUGINS) |
| - RenderViewImpl* const render_view_impl_; |
| -#endif |
| + // The render widget whose incoming TextInputClientMac IPCs are handled. |
| + scoped_refptr<RenderWidget> render_widget_; |
| + |
| + // TODO(ekaramad): We should not be using a WebView here. Everything should |
| + // go through WebWidget. Unfortunately, WebSubStringUril uses WebView for some |
| + // of the methods used and casting WebWidget to WebViewImpl is no longer |
| + // possible. The whole logic should be changed so that we only use WebWidget. |
| + // The WebView used to apply hit testing to query string and character index. |
| + blink::WebView* web_view_; |
| DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver); |
| }; |