Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: content/browser/android/ime_adapter_android.h

Issue 2777223004: Migrate IME state update flow (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_ 6 #define CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/browser/web_contents_observer.h" 15 #include "content/public/browser/web_contents_observer.h"
16 #include "ui/gfx/geometry/rect_f.h" 16 #include "ui/gfx/geometry/rect_f.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 struct WebCompositionUnderline; 20 struct WebCompositionUnderline;
21 21
22 } // namespace blink 22 } // namespace blink
23 23
24 namespace content { 24 namespace content {
25 25
26 class RenderFrameHost; 26 class RenderFrameHost;
27 class RenderWidgetHostImpl; 27 class RenderWidgetHostImpl;
28 class RenderWidgetHostViewAndroid; 28 class RenderWidgetHostViewAndroid;
29 struct TextInputState;
29 30
30 // This class is in charge of dispatching key events from the java side 31 // This class is in charge of dispatching key events from the java side
31 // and forward to renderer along with input method results via 32 // and forward to renderer along with input method results via
32 // corresponding host view. 33 // corresponding host view.
33 // Ownership of these objects remains on the native side (see 34 // Ownership of these objects remains on the native side (see
34 // RenderWidgetHostViewAndroid). 35 // RenderWidgetHostViewAndroid).
35 class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver { 36 class CONTENT_EXPORT ImeAdapterAndroid : public WebContentsObserver {
36 public: 37 public:
37 ImeAdapterAndroid(JNIEnv* env, 38 ImeAdapterAndroid(JNIEnv* env,
38 const base::android::JavaParamRef<jobject>& obj, 39 const base::android::JavaParamRef<jobject>& obj,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 99 }
99 100
100 // WebContentsObserver implementation. 101 // WebContentsObserver implementation.
101 void RenderViewReady() override; 102 void RenderViewReady() override;
102 void RenderViewHostChanged(RenderViewHost* old_host, 103 void RenderViewHostChanged(RenderViewHost* old_host,
103 RenderViewHost* new_host) override; 104 RenderViewHost* new_host) override;
104 void DidAttachInterstitialPage() override; 105 void DidAttachInterstitialPage() override;
105 void DidDetachInterstitialPage() override; 106 void DidDetachInterstitialPage() override;
106 void WebContentsDestroyed() override; 107 void WebContentsDestroyed() override;
107 108
109 void UpdateState(const TextInputState& state);
110
108 private: 111 private:
109 RenderWidgetHostImpl* GetFocusedWidget(); 112 RenderWidgetHostImpl* GetFocusedWidget();
110 RenderFrameHost* GetFocusedFrame(); 113 RenderFrameHost* GetFocusedFrame();
111 std::vector<blink::WebCompositionUnderline> GetUnderlinesFromSpans( 114 std::vector<blink::WebCompositionUnderline> GetUnderlinesFromSpans(
112 JNIEnv* env, 115 JNIEnv* env,
113 const base::android::JavaParamRef<jobject>& obj, 116 const base::android::JavaParamRef<jobject>& obj,
114 const base::android::JavaParamRef<jobject>& text, 117 const base::android::JavaParamRef<jobject>& text,
115 const base::string16& text16); 118 const base::string16& text16);
116 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; 119 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const;
117 void UpdateRenderProcessConnection(RenderWidgetHostViewAndroid* new_rwhva); 120 void UpdateRenderProcessConnection(RenderWidgetHostViewAndroid* new_rwhva);
118 121
119 base::WeakPtr<RenderWidgetHostViewAndroid> rwhva_; 122 base::WeakPtr<RenderWidgetHostViewAndroid> rwhva_;
120 JavaObjectWeakGlobalRef java_ime_adapter_; 123 JavaObjectWeakGlobalRef java_ime_adapter_;
121 }; 124 };
122 125
123 bool RegisterImeAdapter(JNIEnv* env); 126 bool RegisterImeAdapter(JNIEnv* env);
124 127
125 } // namespace content 128 } // namespace content
126 129
127 #endif // CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_ 130 #endif // CONTENT_BROWSER_ANDROID_IME_ADAPTER_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/android/ime_adapter_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698