| OLD | NEW |
| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 178 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 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_) |
| 189 content_view_core_->ForceUpdateImeAdapter(rwhv->GetNativeImeAdapter()); |
| 188 } else { | 190 } else { |
| 189 rwhv->Focus(); | 191 rwhv->Focus(); |
| 190 } | 192 } |
| 191 } | 193 } |
| 192 | 194 |
| 193 void WebContentsViewAndroid::SetInitialFocus() { | 195 void WebContentsViewAndroid::SetInitialFocus() { |
| 194 if (web_contents_->FocusLocationBarByDefault()) | 196 if (web_contents_->FocusLocationBarByDefault()) |
| 195 web_contents_->SetFocusToLocationBar(false); | 197 web_contents_->SetFocusToLocationBar(false); |
| 196 else | 198 else |
| 197 Focus(); | 199 Focus(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 397 } |
| 396 | 398 |
| 397 bool WebContentsViewAndroid::OnTouchEvent(const ui::MotionEventAndroid& event, | 399 bool WebContentsViewAndroid::OnTouchEvent(const ui::MotionEventAndroid& event, |
| 398 bool for_touch_handle) { | 400 bool for_touch_handle) { |
| 399 if (event.GetAction() == ui::MotionEventAndroid::ACTION_DOWN) | 401 if (event.GetAction() == ui::MotionEventAndroid::ACTION_DOWN) |
| 400 content_view_core_->OnTouchDown(event.GetJavaObject()); | 402 content_view_core_->OnTouchDown(event.GetJavaObject()); |
| 401 return false; // let the children handle the actual event. | 403 return false; // let the children handle the actual event. |
| 402 } | 404 } |
| 403 | 405 |
| 404 } // namespace content | 406 } // namespace content |
| OLD | NEW |