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" |
| 11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
| 12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/metrics/user_metrics.h" | |
| 17 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 18 #include "base/values.h" | 19 #include "base/values.h" |
| 19 #include "cc/layers/layer.h" | 20 #include "cc/layers/layer.h" |
| 20 #include "cc/layers/solid_color_layer.h" | 21 #include "cc/layers/solid_color_layer.h" |
| 21 #include "cc/output/begin_frame_args.h" | 22 #include "cc/output/begin_frame_args.h" |
| 22 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 23 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
| 23 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 24 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 24 #include "content/browser/android/gesture_event_type.h" | 25 #include "content/browser/android/gesture_event_type.h" |
| 25 #include "content/browser/android/interstitial_page_delegate_android.h" | 26 #include "content/browser/android/interstitial_page_delegate_android.h" |
| 26 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" | 27 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 881 GetRenderWidgetHostViewAndroid()->Focus(); | 882 GetRenderWidgetHostViewAndroid()->Focus(); |
| 882 else | 883 else |
| 883 GetRenderWidgetHostViewAndroid()->Blur(); | 884 GetRenderWidgetHostViewAndroid()->Blur(); |
| 884 } | 885 } |
| 885 | 886 |
| 886 void ContentViewCoreImpl::SendOrientationChangeEvent( | 887 void ContentViewCoreImpl::SendOrientationChangeEvent( |
| 887 JNIEnv* env, | 888 JNIEnv* env, |
| 888 const JavaParamRef<jobject>& obj, | 889 const JavaParamRef<jobject>& obj, |
| 889 jint orientation) { | 890 jint orientation) { |
| 890 if (device_orientation_ != orientation) { | 891 if (device_orientation_ != orientation) { |
| 892 base::RecordAction(base::UserMetricsAction("OrientationChange")); | |
|
mlamouri (slow - plz ping)
2016/12/06 13:51:22
nit: I would call this "ScreenOrientationChange" t
Zhiqiang Zhang (Slow)
2016/12/06 17:58:44
Done.
| |
| 891 device_orientation_ = orientation; | 893 device_orientation_ = orientation; |
| 892 SendOrientationChangeEventInternal(); | 894 SendOrientationChangeEventInternal(); |
| 893 } | 895 } |
| 894 } | 896 } |
| 895 | 897 |
| 896 jboolean ContentViewCoreImpl::OnTouchEvent( | 898 jboolean ContentViewCoreImpl::OnTouchEvent( |
| 897 JNIEnv* env, | 899 JNIEnv* env, |
| 898 const JavaParamRef<jobject>& obj, | 900 const JavaParamRef<jobject>& obj, |
| 899 const JavaParamRef<jobject>& motion_event, | 901 const JavaParamRef<jobject>& motion_event, |
| 900 jlong time_ms, | 902 jlong time_ms, |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1615 return ScopedJavaLocalRef<jobject>(); | 1617 return ScopedJavaLocalRef<jobject>(); |
| 1616 | 1618 |
| 1617 return view->GetJavaObject(); | 1619 return view->GetJavaObject(); |
| 1618 } | 1620 } |
| 1619 | 1621 |
| 1620 bool RegisterContentViewCore(JNIEnv* env) { | 1622 bool RegisterContentViewCore(JNIEnv* env) { |
| 1621 return RegisterNativesImpl(env); | 1623 return RegisterNativesImpl(env); |
| 1622 } | 1624 } |
| 1623 | 1625 |
| 1624 } // namespace content | 1626 } // namespace content |
| OLD | NEW |