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