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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
17 #include "cc/layers/solid_color_layer.h" | 17 #include "cc/layers/solid_color_layer.h" |
18 #include "cc/output/begin_frame_args.h" | 18 #include "cc/output/begin_frame_args.h" |
19 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 19 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
20 #include "content/browser/android/gesture_event_type.h" | 20 #include "content/browser/android/gesture_event_type.h" |
21 #include "content/browser/android/interstitial_page_delegate_android.h" | 21 #include "content/browser/android/interstitial_page_delegate_android.h" |
22 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" | 22 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" |
23 #include "content/browser/android/load_url_params.h" | 23 #include "content/browser/android/load_url_params.h" |
24 #include "content/browser/android/popup_touch_handle_drawable.h" | 24 #include "content/browser/android/popup_touch_handle_drawable.h" |
25 #include "content/browser/frame_host/interstitial_page_impl.h" | 25 #include "content/browser/frame_host/interstitial_page_impl.h" |
26 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 26 #include "content/browser/geolocation/geolocation_service_context.h" |
27 #include "content/browser/media/media_web_contents_observer.h" | 27 #include "content/browser/media/media_web_contents_observer.h" |
28 #include "content/browser/renderer_host/compositor_impl_android.h" | 28 #include "content/browser/renderer_host/compositor_impl_android.h" |
29 #include "content/browser/renderer_host/input/motion_event_android.h" | 29 #include "content/browser/renderer_host/input/motion_event_android.h" |
30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" | 30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h
" |
31 #include "content/browser/renderer_host/input/web_input_event_util.h" | 31 #include "content/browser/renderer_host/input/web_input_event_util.h" |
32 #include "content/browser/renderer_host/render_view_host_impl.h" | 32 #include "content/browser/renderer_host/render_view_host_impl.h" |
33 #include "content/browser/renderer_host/render_widget_host_impl.h" | 33 #include "content/browser/renderer_host/render_widget_host_impl.h" |
34 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 34 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
35 #include "content/browser/transition_request_manager.h" | 35 #include "content/browser/transition_request_manager.h" |
36 #include "content/browser/web_contents/web_contents_view_android.h" | 36 #include "content/browser/web_contents/web_contents_view_android.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 } | 356 } |
357 | 357 |
358 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { | 358 jint ContentViewCoreImpl::GetBackgroundColor(JNIEnv* env, jobject obj) { |
359 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 359 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
360 if (!rwhva) | 360 if (!rwhva) |
361 return SK_ColorWHITE; | 361 return SK_ColorWHITE; |
362 return rwhva->GetCachedBackgroundColor(); | 362 return rwhva->GetCachedBackgroundColor(); |
363 } | 363 } |
364 | 364 |
365 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { | 365 void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) { |
366 web_contents_->geolocation_dispatcher_host()->PauseOrResume(should_pause); | 366 if (should_pause) |
| 367 web_contents_->GetGeolocationServiceContext()->PauseUpdates(); |
| 368 else |
| 369 web_contents_->GetGeolocationServiceContext()->ResumeUpdates(); |
367 } | 370 } |
368 | 371 |
369 // All positions and sizes are in CSS pixels. | 372 // All positions and sizes are in CSS pixels. |
370 // Note that viewport_width/height is a best effort based. | 373 // Note that viewport_width/height is a best effort based. |
371 // ContentViewCore has the actual information about the physical viewport size. | 374 // ContentViewCore has the actual information about the physical viewport size. |
372 void ContentViewCoreImpl::UpdateFrameInfo( | 375 void ContentViewCoreImpl::UpdateFrameInfo( |
373 const gfx::Vector2dF& scroll_offset, | 376 const gfx::Vector2dF& scroll_offset, |
374 float page_scale_factor, | 377 float page_scale_factor, |
375 const gfx::Vector2dF& page_scale_factor_limits, | 378 const gfx::Vector2dF& page_scale_factor_limits, |
376 const gfx::SizeF& content_size, | 379 const gfx::SizeF& content_size, |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1305 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1308 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1306 retained_objects_set); | 1309 retained_objects_set); |
1307 return reinterpret_cast<intptr_t>(view); | 1310 return reinterpret_cast<intptr_t>(view); |
1308 } | 1311 } |
1309 | 1312 |
1310 bool RegisterContentViewCore(JNIEnv* env) { | 1313 bool RegisterContentViewCore(JNIEnv* env) { |
1311 return RegisterNativesImpl(env); | 1314 return RegisterNativesImpl(env); |
1312 } | 1315 } |
1313 | 1316 |
1314 } // namespace content | 1317 } // namespace content |
OLD | NEW |