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

Side by Side Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2752113005: Let ImeAdapterAndroid have the same lifecycle as its Java peer (Closed)
Patch Set: s/isValid/mIsConnected/ Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "content/browser/web_contents/web_contents_view_android.h" 5 #include "content/browser/web_contents/web_contents_view_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (rwhv) 179 if (rwhv)
180 rwhv->SetSize(size); 180 rwhv->SetSize(size);
181 } 181 }
182 182
183 void WebContentsViewAndroid::Focus() { 183 void WebContentsViewAndroid::Focus() {
184 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( 184 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
185 web_contents_->GetRenderWidgetHostView()); 185 web_contents_->GetRenderWidgetHostView());
186 if (web_contents_->ShowingInterstitialPage()) { 186 if (web_contents_->ShowingInterstitialPage()) {
187 web_contents_->GetInterstitialPage()->Focus(); 187 web_contents_->GetInterstitialPage()->Focus();
188 if (content_view_core_) 188 if (content_view_core_)
189 content_view_core_->ForceUpdateImeAdapter(rwhv->GetNativeImeAdapter()); 189 rwhv->ConnectImeAdapter(content_view_core_->ime_adapter());
190 } else { 190 } else {
191 rwhv->Focus(); 191 rwhv->Focus();
192 } 192 }
193 } 193 }
194 194
195 void WebContentsViewAndroid::SetInitialFocus() { 195 void WebContentsViewAndroid::SetInitialFocus() {
196 if (web_contents_->FocusLocationBarByDefault()) 196 if (web_contents_->FocusLocationBarByDefault())
197 web_contents_->SetFocusToLocationBar(false); 197 web_contents_->SetFocusToLocationBar(false);
198 else 198 else
199 Focus(); 199 Focus();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 bool WebContentsViewAndroid::OnTouchEvent(const ui::MotionEventAndroid& event, 399 bool WebContentsViewAndroid::OnTouchEvent(const ui::MotionEventAndroid& event,
400 bool for_touch_handle) { 400 bool for_touch_handle) {
401 if (event.GetAction() == ui::MotionEventAndroid::ACTION_DOWN) 401 if (event.GetAction() == ui::MotionEventAndroid::ACTION_DOWN)
402 content_view_core_->OnTouchDown(event.GetJavaObject()); 402 content_view_core_->OnTouchDown(event.GetJavaObject());
403 return false; // let the children handle the actual event. 403 return false; // let the children handle the actual event.
404 } 404 }
405 405
406 } // namespace content 406 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698