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/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" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 web_contents_(static_cast<WebContentsImpl*>(web_contents)), | 90 web_contents_(static_cast<WebContentsImpl*>(web_contents)), |
91 tab_crashed_(false), | 91 tab_crashed_(false), |
92 window_android_(window_android) { | 92 window_android_(window_android) { |
93 DCHECK(web_contents) << | 93 DCHECK(web_contents) << |
94 "A ContentViewCoreImpl should be created with a valid WebContents."; | 94 "A ContentViewCoreImpl should be created with a valid WebContents."; |
95 | 95 |
96 // TODO(leandrogracia): make use of the hardware_accelerated argument. | 96 // TODO(leandrogracia): make use of the hardware_accelerated argument. |
97 | 97 |
98 InitJNI(env, obj); | 98 InitJNI(env, obj); |
99 | 99 |
100 if (!gfx::Screen::IsDIPEnabled()) { | 100 if (!gfx::Screen::GetNativeScreen()->IsDIPEnabled()) { |
101 dpi_scale_ = 1; | 101 dpi_scale_ = 1; |
102 } else { | 102 } else { |
103 scoped_ptr<content::DeviceInfo> device_info(new content::DeviceInfo()); | 103 scoped_ptr<content::DeviceInfo> device_info(new content::DeviceInfo()); |
104 dpi_scale_ = device_info->GetDPIScale(); | 104 dpi_scale_ = device_info->GetDPIScale(); |
105 } | 105 } |
106 | 106 |
107 notification_registrar_.Add(this, | 107 notification_registrar_.Add(this, |
108 NOTIFICATION_EXECUTE_JAVASCRIPT_RESULT, | 108 NOTIFICATION_EXECUTE_JAVASCRIPT_RESULT, |
109 NotificationService::AllSources()); | 109 NotificationService::AllSources()); |
110 | 110 |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 926 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
927 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 927 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
928 return false; | 928 return false; |
929 } | 929 } |
930 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 930 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
931 | 931 |
932 return RegisterNativesImpl(env) >= 0; | 932 return RegisterNativesImpl(env) >= 0; |
933 } | 933 } |
934 | 934 |
935 } // namespace content | 935 } // namespace content |
OLD | NEW |