Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 ContentViewCore* ContentViewCore::GetNativeContentViewCore(JNIEnv* env, | 205 ContentViewCore* ContentViewCore::GetNativeContentViewCore(JNIEnv* env, |
| 206 jobject obj) { | 206 jobject obj) { |
| 207 return reinterpret_cast<ContentViewCore*>( | 207 return reinterpret_cast<ContentViewCore*>( |
| 208 Java_ContentViewCore_getNativeContentViewCore(env, obj)); | 208 Java_ContentViewCore_getNativeContentViewCore(env, obj)); |
| 209 } | 209 } |
| 210 | 210 |
| 211 ContentViewCoreImpl::ContentViewCoreImpl( | 211 ContentViewCoreImpl::ContentViewCoreImpl( |
| 212 JNIEnv* env, | 212 JNIEnv* env, |
| 213 jobject obj, | 213 jobject obj, |
| 214 WebContents* web_contents, | 214 WebContents* web_contents, |
| 215 jobject view_android_delegate, | 215 const base::android::JavaRef<jobject>& view_android_delegate, |
| 216 ui::WindowAndroid* window_android, | 216 ui::WindowAndroid* window_android, |
| 217 jobject java_bridge_retained_object_set) | 217 jobject java_bridge_retained_object_set) |
| 218 : WebContentsObserver(web_contents), | 218 : WebContentsObserver(web_contents), |
| 219 java_ref_(env, obj), | 219 java_ref_(env, obj), |
| 220 view_android_(view_android_delegate, window_android), | |
| 220 web_contents_(static_cast<WebContentsImpl*>(web_contents)), | 221 web_contents_(static_cast<WebContentsImpl*>(web_contents)), |
| 221 root_layer_(cc::SolidColorLayer::Create()), | |
| 222 page_scale_(1), | 222 page_scale_(1), |
| 223 dpi_scale_(ui::GetScaleFactorForNativeView(this)), | 223 dpi_scale_(ui::GetScaleFactorForNativeView(&view_android_)), |
| 224 window_android_(window_android), | |
| 225 device_orientation_(0), | 224 device_orientation_(0), |
| 226 accessibility_enabled_(false) { | 225 accessibility_enabled_(false) { |
| 227 CHECK(web_contents) << | 226 CHECK(web_contents) << |
| 228 "A ContentViewCoreImpl should be created with a valid WebContents."; | 227 "A ContentViewCoreImpl should be created with a valid WebContents."; |
| 229 DCHECK(window_android_); | 228 DCHECK(window_android); |
| 230 DCHECK(view_android_delegate); | 229 DCHECK(!view_android_delegate.is_null()); |
| 231 view_android_delegate_.Reset(AttachCurrentThread(), view_android_delegate); | 230 view_android_.SetLayer(cc::SolidColorLayer::Create()); |
| 232 root_layer_->SetBackgroundColor(GetBackgroundColor(env, obj)); | 231 view_android_.GetLayer()->SetBackgroundColor(GetBackgroundColor(env, obj)); |
| 233 gfx::Size physical_size( | 232 gfx::Size physical_size( |
| 234 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), | 233 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), |
| 235 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); | 234 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); |
| 236 root_layer_->SetBounds(physical_size); | 235 view_android_.GetLayer()->SetBounds(physical_size); |
| 237 root_layer_->SetIsDrawable(true); | 236 view_android_.GetLayer()->SetIsDrawable(true); |
| 238 | 237 |
| 239 // Currently, the only use case we have for overriding a user agent involves | 238 // Currently, the only use case we have for overriding a user agent involves |
| 240 // spoofing a desktop Linux user agent for "Request desktop site". | 239 // spoofing a desktop Linux user agent for "Request desktop site". |
| 241 // Automatically set it for all WebContents so that it is available when a | 240 // Automatically set it for all WebContents so that it is available when a |
| 242 // NavigationEntry requires the user agent to be overridden. | 241 // NavigationEntry requires the user agent to be overridden. |
| 243 const char kLinuxInfoStr[] = "X11; Linux x86_64"; | 242 const char kLinuxInfoStr[] = "X11; Linux x86_64"; |
| 244 std::string product = content::GetContentClient()->GetProduct(); | 243 std::string product = content::GetContentClient()->GetProduct(); |
| 245 std::string spoofed_ua = | 244 std::string spoofed_ua = |
| 246 BuildUserAgentFromOSAndProduct(kLinuxInfoStr, product); | 245 BuildUserAgentFromOSAndProduct(kLinuxInfoStr, product); |
| 247 web_contents->SetUserAgentOverride(spoofed_ua); | 246 web_contents->SetUserAgentOverride(spoofed_ua); |
| 248 | 247 |
| 249 java_bridge_dispatcher_host_ = | 248 java_bridge_dispatcher_host_ = |
| 250 new GinJavaBridgeDispatcherHost(web_contents, | 249 new GinJavaBridgeDispatcherHost(web_contents, |
| 251 java_bridge_retained_object_set); | 250 java_bridge_retained_object_set); |
| 252 | 251 |
| 253 InitWebContents(); | 252 InitWebContents(); |
| 254 } | 253 } |
| 255 | 254 |
| 256 void ContentViewCoreImpl::AddObserver( | 255 void ContentViewCoreImpl::AddObserver( |
| 257 ContentViewCoreImplObserver* observer) { | 256 ContentViewCoreImplObserver* observer) { |
| 258 observer_list_.AddObserver(observer); | 257 observer_list_.AddObserver(observer); |
| 259 } | 258 } |
| 260 | 259 |
| 261 void ContentViewCoreImpl::RemoveObserver( | 260 void ContentViewCoreImpl::RemoveObserver( |
| 262 ContentViewCoreImplObserver* observer) { | 261 ContentViewCoreImplObserver* observer) { |
| 263 observer_list_.RemoveObserver(observer); | 262 observer_list_.RemoveObserver(observer); |
| 264 } | 263 } |
| 265 | 264 |
| 266 ContentViewCoreImpl::~ContentViewCoreImpl() { | 265 ContentViewCoreImpl::~ContentViewCoreImpl() { |
| 267 root_layer_->RemoveFromParent(); | 266 view_android_.GetLayer()->RemoveFromParent(); |
| 268 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, | 267 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, |
| 269 observer_list_, | 268 observer_list_, |
| 270 OnContentViewCoreDestroyed()); | 269 OnContentViewCoreDestroyed()); |
| 271 observer_list_.Clear(); | 270 observer_list_.Clear(); |
| 272 | 271 |
| 273 JNIEnv* env = base::android::AttachCurrentThread(); | 272 JNIEnv* env = base::android::AttachCurrentThread(); |
| 274 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 273 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 275 java_ref_.reset(); | 274 java_ref_.reset(); |
| 276 if (!j_obj.is_null()) { | 275 if (!j_obj.is_null()) { |
| 277 Java_ContentViewCore_onNativeContentViewCoreDestroyed( | 276 Java_ContentViewCore_onNativeContentViewCoreDestroyed( |
| 278 env, j_obj.obj(), reinterpret_cast<intptr_t>(this)); | 277 env, j_obj.obj(), reinterpret_cast<intptr_t>(this)); |
| 279 } | 278 } |
| 280 } | 279 } |
| 281 | 280 |
| 282 void ContentViewCoreImpl::UpdateWindowAndroid( | 281 void ContentViewCoreImpl::UpdateWindowAndroid( |
| 283 JNIEnv* env, | 282 JNIEnv* env, |
| 284 const base::android::JavaParamRef<jobject>& obj, | 283 const base::android::JavaParamRef<jobject>& obj, |
| 285 jlong window_android) { | 284 jlong window_android) { |
| 286 if (window_android) { | 285 if (window_android) { |
| 287 DCHECK(!window_android_); | 286 DCHECK(!view_android_.GetWindowAndroid()); |
| 288 window_android_ = reinterpret_cast<ui::WindowAndroid*>(window_android); | 287 view_android_.SetWindowAndroid( |
| 288 reinterpret_cast<ui::WindowAndroid*>(window_android)); | |
| 289 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, | 289 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, |
| 290 observer_list_, | 290 observer_list_, |
| 291 OnAttachedToWindow()); | 291 OnAttachedToWindow()); |
| 292 } else { | 292 } else { |
| 293 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, | 293 FOR_EACH_OBSERVER(ContentViewCoreImplObserver, |
| 294 observer_list_, | 294 observer_list_, |
| 295 OnDetachedFromWindow()); | 295 OnDetachedFromWindow()); |
| 296 window_android_ = NULL; | 296 view_android_.SetWindowAndroid(nullptr); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 | 299 |
| 300 base::android::ScopedJavaLocalRef<jobject> | 300 base::android::ScopedJavaLocalRef<jobject> |
| 301 ContentViewCoreImpl::GetWebContentsAndroid(JNIEnv* env, | 301 ContentViewCoreImpl::GetWebContentsAndroid(JNIEnv* env, |
| 302 const JavaParamRef<jobject>& obj) { | 302 const JavaParamRef<jobject>& obj) { |
| 303 return web_contents_->GetJavaWebContents(); | 303 return web_contents_->GetJavaWebContents(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 base::android::ScopedJavaLocalRef<jobject> | 306 base::android::ScopedJavaLocalRef<jobject> |
| 307 ContentViewCoreImpl::GetJavaWindowAndroid(JNIEnv* env, | 307 ContentViewCoreImpl::GetJavaWindowAndroid(JNIEnv* env, |
| 308 const JavaParamRef<jobject>& obj) { | 308 const JavaParamRef<jobject>& obj) { |
| 309 if (!window_android_) | 309 if (!view_android_.GetWindowAndroid()) |
| 310 return ScopedJavaLocalRef<jobject>(); | 310 return ScopedJavaLocalRef<jobject>(); |
| 311 return window_android_->GetJavaObject(); | 311 return view_android_.GetWindowAndroid()->GetJavaObject(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void ContentViewCoreImpl::OnJavaContentViewCoreDestroyed( | 314 void ContentViewCoreImpl::OnJavaContentViewCoreDestroyed( |
| 315 JNIEnv* env, | 315 JNIEnv* env, |
| 316 const JavaParamRef<jobject>& obj) { | 316 const JavaParamRef<jobject>& obj) { |
| 317 DCHECK(env->IsSameObject(java_ref_.get(env).obj(), obj)); | 317 DCHECK(env->IsSameObject(java_ref_.get(env).obj(), obj)); |
| 318 java_ref_.reset(); | 318 java_ref_.reset(); |
| 319 // Java peer has gone, ContentViewCore is not functional and waits to | 319 // Java peer has gone, ContentViewCore is not functional and waits to |
| 320 // be destroyed with WebContents. | 320 // be destroyed with WebContents. |
| 321 // We need to reset WebContentsViewAndroid's reference, otherwise, there | 321 // We need to reset WebContentsViewAndroid's reference, otherwise, there |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 422 float page_scale_factor, | 422 float page_scale_factor, |
| 423 const gfx::Vector2dF& page_scale_factor_limits, | 423 const gfx::Vector2dF& page_scale_factor_limits, |
| 424 const gfx::SizeF& content_size, | 424 const gfx::SizeF& content_size, |
| 425 const gfx::SizeF& viewport_size, | 425 const gfx::SizeF& viewport_size, |
| 426 const gfx::Vector2dF& controls_offset, | 426 const gfx::Vector2dF& controls_offset, |
| 427 const gfx::Vector2dF& content_offset, | 427 const gfx::Vector2dF& content_offset, |
| 428 bool is_mobile_optimized_hint, | 428 bool is_mobile_optimized_hint, |
| 429 const gfx::SelectionBound& selection_start) { | 429 const gfx::SelectionBound& selection_start) { |
| 430 JNIEnv* env = AttachCurrentThread(); | 430 JNIEnv* env = AttachCurrentThread(); |
| 431 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 431 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 432 if (obj.is_null() || !window_android_) | 432 if (obj.is_null() || !view_android_.GetWindowAndroid()) |
| 433 return; | 433 return; |
| 434 | 434 |
| 435 window_android_->set_content_offset( | 435 view_android_.GetWindowAndroid()->set_content_offset( |
| 436 gfx::ScaleVector2d(content_offset, dpi_scale_)); | 436 gfx::ScaleVector2d(content_offset, dpi_scale_)); |
| 437 | 437 |
| 438 page_scale_ = page_scale_factor; | 438 page_scale_ = page_scale_factor; |
| 439 | 439 |
| 440 // The CursorAnchorInfo API in Android only supports zero width selection | 440 // The CursorAnchorInfo API in Android only supports zero width selection |
| 441 // bounds. | 441 // bounds. |
| 442 const jboolean has_insertion_marker = | 442 const jboolean has_insertion_marker = |
| 443 selection_start.type() == gfx::SelectionBound::CENTER; | 443 selection_start.type() == gfx::SelectionBound::CENTER; |
| 444 const jboolean is_insertion_marker_visible = selection_start.visible(); | 444 const jboolean is_insertion_marker_visible = selection_start.visible(); |
| 445 const jfloat insertion_marker_horizontal = | 445 const jfloat insertion_marker_horizontal = |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 474 JNIEnv* env = AttachCurrentThread(); | 474 JNIEnv* env = AttachCurrentThread(); |
| 475 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 475 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 476 if (obj.is_null()) | 476 if (obj.is_null()) |
| 477 return; | 477 return; |
| 478 ScopedJavaLocalRef<jstring> jtitle = | 478 ScopedJavaLocalRef<jstring> jtitle = |
| 479 ConvertUTF8ToJavaString(env, base::UTF16ToUTF8(title)); | 479 ConvertUTF8ToJavaString(env, base::UTF16ToUTF8(title)); |
| 480 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); | 480 Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj()); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { | 483 void ContentViewCoreImpl::OnBackgroundColorChanged(SkColor color) { |
| 484 root_layer_->SetBackgroundColor(color); | 484 view_android_.GetLayer()->SetBackgroundColor(color); |
| 485 | 485 |
| 486 JNIEnv* env = AttachCurrentThread(); | 486 JNIEnv* env = AttachCurrentThread(); |
| 487 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 487 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 488 if (obj.is_null()) | 488 if (obj.is_null()) |
| 489 return; | 489 return; |
| 490 Java_ContentViewCore_onBackgroundColorChanged(env, obj.obj(), color); | 490 Java_ContentViewCore_onBackgroundColorChanged(env, obj.obj(), color); |
| 491 } | 491 } |
| 492 | 492 |
| 493 void ContentViewCoreImpl::ShowSelectPopupMenu( | 493 void ContentViewCoreImpl::ShowSelectPopupMenu( |
| 494 RenderFrameHost* frame, | 494 RenderFrameHost* frame, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 if (j_obj.is_null()) | 824 if (j_obj.is_null()) |
| 825 return false; | 825 return false; |
| 826 return Java_ContentViewCore_doTopControlsShrinkBlinkSize(env, j_obj.obj()); | 826 return Java_ContentViewCore_doTopControlsShrinkBlinkSize(env, j_obj.obj()); |
| 827 } | 827 } |
| 828 | 828 |
| 829 float ContentViewCoreImpl::GetTopControlsHeightDip() const { | 829 float ContentViewCoreImpl::GetTopControlsHeightDip() const { |
| 830 return GetTopControlsHeightPix() / dpi_scale(); | 830 return GetTopControlsHeightPix() / dpi_scale(); |
| 831 } | 831 } |
| 832 | 832 |
| 833 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { | 833 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |
| 834 root_layer_->InsertChild(layer, 0); | 834 view_android_.GetLayer()->InsertChild(layer, 0); |
| 835 root_layer_->SetIsDrawable(false); | 835 view_android_.GetLayer()->SetIsDrawable(false); |
| 836 } | 836 } |
| 837 | 837 |
| 838 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { | 838 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { |
| 839 layer->RemoveFromParent(); | 839 layer->RemoveFromParent(); |
| 840 | 840 |
| 841 if (root_layer_->children().empty()) | 841 if (!view_android_.GetLayer()->children().empty()) |
| 842 root_layer_->SetIsDrawable(true); | 842 view_android_.GetLayer()->SetIsDrawable(true); |
| 843 } | 843 } |
| 844 | 844 |
| 845 void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) { | 845 void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) { |
| 846 if (!web_contents_) | 846 if (!web_contents_) |
| 847 return; | 847 return; |
| 848 | 848 |
| 849 web_contents_->MoveRangeSelectionExtent(gfx::ToRoundedPoint(extent)); | 849 web_contents_->MoveRangeSelectionExtent(gfx::ToRoundedPoint(extent)); |
| 850 } | 850 } |
| 851 | 851 |
| 852 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base, | 852 void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base, |
| 853 const gfx::PointF& extent) { | 853 const gfx::PointF& extent) { |
| 854 if (!web_contents_) | 854 if (!web_contents_) |
| 855 return; | 855 return; |
| 856 | 856 |
| 857 gfx::Point base_point = gfx::ToRoundedPoint(base); | 857 gfx::Point base_point = gfx::ToRoundedPoint(base); |
| 858 gfx::Point extent_point = gfx::ToRoundedPoint(extent); | 858 gfx::Point extent_point = gfx::ToRoundedPoint(extent); |
| 859 if (base_point == extent_point) | 859 if (base_point == extent_point) |
| 860 return; | 860 return; |
| 861 | 861 |
| 862 web_contents_->SelectRange(base_point, extent_point); | 862 web_contents_->SelectRange(base_point, extent_point); |
| 863 } | 863 } |
| 864 | 864 |
| 865 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetViewAndroidDelegate() | 865 const base::android::JavaRef<jobject>& |
| 866 const { | 866 ContentViewCoreImpl::GetViewAndroidDelegate() const { |
| 867 return base::android::ScopedJavaLocalRef<jobject>(view_android_delegate_); | 867 return view_android_.GetViewAndroidDelegate(); |
| 868 } | 868 } |
| 869 | 869 |
| 870 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { | 870 ui::WindowAndroid* ContentViewCoreImpl::GetWindowAndroid() const { |
| 871 return window_android_; | 871 return view_android_.GetWindowAndroid(); |
| 872 } | 872 } |
| 873 | 873 |
| 874 const scoped_refptr<cc::Layer>& ContentViewCoreImpl::GetLayer() const { | 874 cc::Layer* ContentViewCoreImpl::GetLayer() const { |
| 875 return root_layer_; | 875 return view_android_.GetLayer(); |
|
Yusuf
2016/07/08 23:06:00
CVC and RWHVAndroid are both Android specific, we
no sievers
2016/07/08 23:24:22
True. I've made it CVC::view_ since 'android' is a
| |
| 876 } | 876 } |
| 877 | 877 |
| 878 ui::ViewAndroid* ContentViewCoreImpl::GetViewAndroid() { | |
| 879 return &view_android_; | |
| 880 } | |
| 881 | |
| 882 | |
| 878 // ---------------------------------------------------------------------------- | 883 // ---------------------------------------------------------------------------- |
| 879 // Methods called from Java via JNI | 884 // Methods called from Java via JNI |
| 880 // ---------------------------------------------------------------------------- | 885 // ---------------------------------------------------------------------------- |
| 881 | 886 |
| 882 void ContentViewCoreImpl::SelectPopupMenuItems( | 887 void ContentViewCoreImpl::SelectPopupMenuItems( |
| 883 JNIEnv* env, | 888 JNIEnv* env, |
| 884 const JavaParamRef<jobject>& obj, | 889 const JavaParamRef<jobject>& obj, |
| 885 jlong selectPopupSourceFrame, | 890 jlong selectPopupSourceFrame, |
| 886 const JavaParamRef<jintArray>& indices) { | 891 const JavaParamRef<jintArray>& indices) { |
| 887 RenderFrameHostImpl* rfhi = | 892 RenderFrameHostImpl* rfhi = |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1291 java_bridge_dispatcher_host_->RemoveNamedObject( | 1296 java_bridge_dispatcher_host_->RemoveNamedObject( |
| 1292 ConvertJavaStringToUTF8(env, name)); | 1297 ConvertJavaStringToUTF8(env, name)); |
| 1293 } | 1298 } |
| 1294 | 1299 |
| 1295 void ContentViewCoreImpl::WasResized(JNIEnv* env, | 1300 void ContentViewCoreImpl::WasResized(JNIEnv* env, |
| 1296 const JavaParamRef<jobject>& obj) { | 1301 const JavaParamRef<jobject>& obj) { |
| 1297 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 1302 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 1298 gfx::Size physical_size( | 1303 gfx::Size physical_size( |
| 1299 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), | 1304 Java_ContentViewCore_getPhysicalBackingWidthPix(env, obj), |
| 1300 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); | 1305 Java_ContentViewCore_getPhysicalBackingHeightPix(env, obj)); |
| 1301 root_layer_->SetBounds(physical_size); | 1306 view_android_.GetLayer()->SetBounds(physical_size); |
| 1302 | 1307 |
| 1303 if (view) { | 1308 if (view) { |
| 1304 web_contents_->SendScreenRects(); | 1309 web_contents_->SendScreenRects(); |
| 1305 view->WasResized(); | 1310 view->WasResized(); |
| 1306 } | 1311 } |
| 1307 } | 1312 } |
| 1308 | 1313 |
| 1309 long ContentViewCoreImpl::GetNativeImeAdapter( | 1314 long ContentViewCoreImpl::GetNativeImeAdapter( |
| 1310 JNIEnv* env, | 1315 JNIEnv* env, |
| 1311 const JavaParamRef<jobject>& obj) { | 1316 const JavaParamRef<jobject>& obj) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1428 if (web_contents_) { | 1433 if (web_contents_) { |
| 1429 web_contents_->SetAccessibilityMode( | 1434 web_contents_->SetAccessibilityMode( |
| 1430 accessibility_state->accessibility_mode()); | 1435 accessibility_state->accessibility_mode()); |
| 1431 } | 1436 } |
| 1432 } | 1437 } |
| 1433 } | 1438 } |
| 1434 | 1439 |
| 1435 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { | 1440 void ContentViewCoreImpl::SendOrientationChangeEventInternal() { |
| 1436 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 1441 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
| 1437 if (rwhv) | 1442 if (rwhv) |
| 1438 rwhv->UpdateScreenInfo(this); | 1443 rwhv->UpdateScreenInfo(&view_android_); |
| 1439 | 1444 |
| 1440 static_cast<WebContentsImpl*>(web_contents())-> | 1445 static_cast<WebContentsImpl*>(web_contents())-> |
| 1441 screen_orientation_dispatcher_host()->OnOrientationChange(); | 1446 screen_orientation_dispatcher_host()->OnOrientationChange(); |
| 1442 } | 1447 } |
| 1443 | 1448 |
| 1444 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, | 1449 void ContentViewCoreImpl::ExtractSmartClipData(JNIEnv* env, |
| 1445 const JavaParamRef<jobject>& obj, | 1450 const JavaParamRef<jobject>& obj, |
| 1446 jint x, | 1451 jint x, |
| 1447 jint y, | 1452 jint y, |
| 1448 jint width, | 1453 jint width, |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 return ScopedJavaLocalRef<jobject>(); | 1647 return ScopedJavaLocalRef<jobject>(); |
| 1643 | 1648 |
| 1644 return view->GetJavaObject(); | 1649 return view->GetJavaObject(); |
| 1645 } | 1650 } |
| 1646 | 1651 |
| 1647 bool RegisterContentViewCore(JNIEnv* env) { | 1652 bool RegisterContentViewCore(JNIEnv* env) { |
| 1648 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); | 1653 return RegisterNativesImpl(env) && JNI_DragEvent::RegisterNativesImpl(env); |
| 1649 } | 1654 } |
| 1650 | 1655 |
| 1651 } // namespace content | 1656 } // namespace content |
| OLD | NEW |