blob: c8d1b4a2e13f2729383a3a99a742e5e0126894d6 [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
8#include "base/basictypes.h"
9#include "build/build_config.h"
[email protected]3a034ebb2011-10-03 19:19:4410#include "content/public/renderer/render_view_observer.h"
[email protected]d4cff272011-05-02 15:46:0111#include "ui/gfx/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:
34 // Returns the WebView of the RenderView.
[email protected]180ef242013-11-07 06:50:4635 blink::WebView* webview();
[email protected]d4cff272011-05-02 15:46:0136
37 // IPC Message handlers:
[email protected]6623d872014-03-18 17:43:1338 void OnStringAtPoint(gfx::Point point);
[email protected]d4cff272011-05-02 15:46:0139 void OnCharacterIndexForPoint(gfx::Point point);
[email protected]db4fc1e2013-09-06 20:01:5140 void OnFirstRectForCharacterRange(gfx::Range range);
41 void OnStringForRange(gfx::Range range);
[email protected]d4cff272011-05-02 15:46:0142
[email protected]b25b3ee2012-01-13 05:19:5443 RenderViewImpl* const render_view_impl_;
44
[email protected]d4cff272011-05-02 15:46:0145 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver);
46};
47
[email protected]e9ff79c2012-10-19 21:31:2648} // namespace content
49
[email protected]86a7d3c2011-09-12 16:45:3250#endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_