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_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_
8 #include "content/common/mac/attributed_string_coder.h"
9 #include "content/public/browser/browser_message_filter.h"
19 // This is a browser-side message filter that lives on the IO thread to handle
20 // replies to messages sent by the TextInputClientMac. See
21 // content/browser/renderer_host/text_input_client_mac.h for more information.
22 class CONTENT_EXPORT TextInputClientMessageFilter
23 : public BrowserMessageFilter {
25 explicit TextInputClientMessageFilter(int child_id);
27 // BrowserMessageFilter override:
28 virtual bool OnMessageReceived(const IPC::Message& message,
29 bool* message_was_ok) OVERRIDE;
32 virtual ~TextInputClientMessageFilter();
35 // IPC Message handlers:
36 void OnGotStringAtPoint(
37 const mac::AttributedStringCoder::EncodedString& encoded_string,
38 const gfx::Point& point);
39 void OnGotCharacterIndexForPoint(size_t index);
40 void OnGotFirstRectForRange(const gfx::Rect& rect);
41 void OnGotStringFromRange(
42 const mac::AttributedStringCoder::EncodedString& string);
45 int child_process_id_;
47 DISALLOW_COPY_AND_ASSIGN(TextInputClientMessageFilter);
50 } // namespace content
52 #endif // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_