blob: 2c538a61c2b9813b18ae21cbb734c1d0f96bf773 [file] [log] [blame]
[email protected]b25b3ee2012-01-13 05:19:541// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]d4cff272011-05-02 15:46:012// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]86a7d3c2011-09-12 16:45:325#ifndef CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_
6#define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_
[email protected]d4cff272011-05-02 15:46:017
avi1023d012015-12-25 02:39:148#include "base/macros.h"
[email protected]d4cff272011-05-02 15:46:019#include "build/build_config.h"
[email protected]3a034ebb2011-10-03 19:19:4410#include "content/public/renderer/render_view_observer.h"
tfarina655f81d2014-12-23 02:38:5011#include "ui/gfx/geometry/point.h"
[email protected]db4fc1e2013-09-06 20:01:5112#include "ui/gfx/range/range.h"
[email protected]d4cff272011-05-02 15:46:0113
[email protected]180ef242013-11-07 06:50:4614namespace blink {
[email protected]d4cff272011-05-02 15:46:0115class WebView;
16}
17
[email protected]e9ff79c2012-10-19 21:31:2618namespace content {
19
20class RenderViewImpl;
21
[email protected]d4cff272011-05-02 15:46:0122// This is the renderer-side message filter that generates the replies for the
23// messages sent by the TextInputClientMac. See
[email protected]86a7d3c2011-09-12 16:45:3224// content/browser/renderer_host/text_input_client_mac.h for more information.
[email protected]e9ff79c2012-10-19 21:31:2625class TextInputClientObserver : public RenderViewObserver {
[email protected]d4cff272011-05-02 15:46:0126 public:
[email protected]310ebd6302011-10-10 19:06:2827 explicit TextInputClientObserver(RenderViewImpl* render_view);
dcheng6d18e402014-10-21 12:32:5228 ~TextInputClientObserver() override;
[email protected]d4cff272011-05-02 15:46:0129
30 // RenderViewObserver overrides:
dcheng6d18e402014-10-21 12:32:5231 bool OnMessageReceived(const IPC::Message& message) override;
[email protected]d4cff272011-05-02 15:46:0132
33 private:
xjz694b50a92016-06-07 21:49:3734 // RenderViewObserver implementation.
35 void OnDestruct() override;
36
[email protected]d4cff272011-05-02 15:46:0137 // Returns the WebView of the RenderView.
[email protected]180ef242013-11-07 06:50:4638 blink::WebView* webview();
[email protected]d4cff272011-05-02 15:46:0139
40 // IPC Message handlers:
[email protected]6623d872014-03-18 17:43:1341 void OnStringAtPoint(gfx::Point point);
[email protected]d4cff272011-05-02 15:46:0142 void OnCharacterIndexForPoint(gfx::Point point);
[email protected]db4fc1e2013-09-06 20:01:5143 void OnFirstRectForCharacterRange(gfx::Range range);
44 void OnStringForRange(gfx::Range range);
[email protected]d4cff272011-05-02 15:46:0145
pkasting10cf76e2016-05-19 18:10:3746#if defined(ENABLE_PLUGINS)
[email protected]b25b3ee2012-01-13 05:19:5447 RenderViewImpl* const render_view_impl_;
pkasting10cf76e2016-05-19 18:10:3748#endif
[email protected]b25b3ee2012-01-13 05:19:5449
[email protected]d4cff272011-05-02 15:46:0150 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver);
51};
52
[email protected]e9ff79c2012-10-19 21:31:2653} // namespace content
54
[email protected]86a7d3c2011-09-12 16:45:3255#endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_