Roll src/third_party/skia ff271c2:b679ca8
[chromium-blink-merge.git] / content / renderer / text_input_client_observer.h
blobf7e872300ab8e2477e74c0d9ea93458f04fc7549
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_
6 #define CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_
8 #include "base/basictypes.h"
9 #include "build/build_config.h"
10 #include "content/public/renderer/render_view_observer.h"
11 #include "ui/gfx/geometry/point.h"
12 #include "ui/gfx/range/range.h"
14 namespace blink {
15 class WebView;
18 namespace content {
20 class RenderViewImpl;
22 // This is the renderer-side message filter that generates the replies for the
23 // messages sent by the TextInputClientMac. See
24 // content/browser/renderer_host/text_input_client_mac.h for more information.
25 class TextInputClientObserver : public RenderViewObserver {
26 public:
27 explicit TextInputClientObserver(RenderViewImpl* render_view);
28 ~TextInputClientObserver() override;
30 // RenderViewObserver overrides:
31 bool OnMessageReceived(const IPC::Message& message) override;
33 private:
34 // Returns the WebView of the RenderView.
35 blink::WebView* webview();
37 // IPC Message handlers:
38 void OnStringAtPoint(gfx::Point point);
39 void OnCharacterIndexForPoint(gfx::Point point);
40 void OnFirstRectForCharacterRange(gfx::Range range);
41 void OnStringForRange(gfx::Range range);
43 RenderViewImpl* const render_view_impl_;
45 DISALLOW_COPY_AND_ASSIGN(TextInputClientObserver);
48 } // namespace content
50 #endif // CONTENT_RENDERER_TEXT_INPUT_CLIENT_OBSERVER_H_