Home | History | Annotate | Download | only in renderer_host
      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.
      4 
      5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_
      6 #define CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_
      7 
      8 #include "content/common/mac/attributed_string_coder.h"
      9 #include "content/public/browser/browser_message_filter.h"
     10 
     11 namespace gfx {
     12 class Range;
     13 class Rect;
     14 }
     15 
     16 namespace content {
     17 
     18 // This is a browser-side message filter that lives on the IO thread to handle
     19 // replies to messages sent by the TextInputClientMac. See
     20 // content/browser/renderer_host/text_input_client_mac.h for more information.
     21 class CONTENT_EXPORT TextInputClientMessageFilter
     22     : public BrowserMessageFilter {
     23  public:
     24   explicit TextInputClientMessageFilter(int child_id);
     25 
     26   // BrowserMessageFilter override:
     27   virtual bool OnMessageReceived(const IPC::Message& message,
     28                                  bool* message_was_ok) OVERRIDE;
     29 
     30  protected:
     31   virtual ~TextInputClientMessageFilter();
     32 
     33  private:
     34   // IPC Message handlers:
     35   void OnGotCharacterIndexForPoint(size_t index);
     36   void OnGotFirstRectForRange(const gfx::Rect& rect);
     37   void OnGotStringFromRange(
     38       const mac::AttributedStringCoder::EncodedString& string);
     39 
     40   // Child process id.
     41   int child_process_id_;
     42 
     43   DISALLOW_COPY_AND_ASSIGN(TextInputClientMessageFilter);
     44 };
     45 
     46 }  // namespace content
     47 
     48 #endif  // CONTENT_BROWSER_RENDERER_HOST_TEXT_INPUT_CLIENT_MESSAGE_FILTER_H_
     49