| Index: ui/base/ime/android/cursor_anchor_info_builder.h | 
| diff --git a/ui/base/ime/android/cursor_anchor_info_builder.h b/ui/base/ime/android/cursor_anchor_info_builder.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..537457aabca7d3c4bb9a9730c7867dc97afa322c | 
| --- /dev/null | 
| +++ b/ui/base/ime/android/cursor_anchor_info_builder.h | 
| @@ -0,0 +1,61 @@ | 
| +// Copyright 2014 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ | 
| +#define UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ | 
| + | 
| +#include <jni.h> | 
| + | 
| +#include "base/android/scoped_java_ref.h" | 
| +#include "base/basictypes.h" | 
| +#include "base/memory/scoped_ptr.h" | 
| +#include "base/strings/string16.h" | 
| +#include "base/strings/string_piece.h" | 
| +#include "ui/base/ui_base_export.h" | 
| +#include "ui/gfx/geometry/rect_f.h" | 
| +#include "ui/gfx/geometry/vector2d_f.h" | 
| +#include "ui/gfx/range/range.h" | 
| + | 
| +namespace ui { | 
| + | 
| +class UI_BASE_EXPORT CursorAnchorInfoBuilder { | 
| + public: | 
| +  // Following values are defined in Android Framework. | 
| +  enum Flags { | 
| +    // android.view.inputmethod.CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION | 
| +    kFlagHasVisibleRegion = 0x01, | 
| +    // android.view.inputmethod.CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION | 
| +    kFlagHasInvisibleRegion = 0x02, | 
| +    // android.view.inputmethod.CursorAnchorInfo.FLAG_IS_RTL | 
| +    kFlagIsRtl = 0x04, | 
| +  }; | 
| + | 
| +  virtual ~CursorAnchorInfoBuilder(); | 
| + | 
| +  virtual void AddCharacterBounds(int index, | 
| +                                  const gfx::RectF& rect, | 
| +                                  uint32 flags) = 0; | 
| +  virtual base::android::ScopedJavaLocalRef<jobject> Build() = 0; | 
| +  virtual void Reset() = 0; | 
| +  virtual void SetComposingText(int composingTextStart, | 
| +                                base::StringPiece16 composingText) = 0; | 
| +  virtual void SetInsertionMarkerLocation(float horizontalPosition, | 
| +                                          float lineTop, | 
| +                                          float lineBaseline, | 
| +                                          float lineBottom, | 
| +                                          uint32 flags) = 0; | 
| +  virtual void SetScaleAndTranslate(float scale, | 
| +                                    const gfx::Vector2dF& translate) = 0; | 
| +  virtual void SetSelectionRange(const gfx::Range& range) = 0; | 
| + | 
| +  static scoped_ptr<CursorAnchorInfoBuilder> Create(); | 
| +  static bool Register(JNIEnv* env); | 
| + | 
| + protected: | 
| +  CursorAnchorInfoBuilder(); | 
| +}; | 
| + | 
| +}  // namespace ui | 
| + | 
| +#endif  // UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ | 
|  |