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" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Popup item is enabled | 81 // Popup item is enabled |
82 POPUP_ITEM_TYPE_ENABLED, | 82 POPUP_ITEM_TYPE_ENABLED, |
83 }; | 83 }; |
84 | 84 |
85 } //namespace | 85 } //namespace |
86 | 86 |
87 namespace content { | 87 namespace content { |
88 | 88 |
89 namespace { | 89 namespace { |
90 | 90 |
91 const void* kContentViewUserDataKey = &kContentViewUserDataKey; | 91 const void* const kContentViewUserDataKey = &kContentViewUserDataKey; |
92 | 92 |
93 int GetRenderProcessIdFromRenderViewHost(RenderViewHost* host) { | 93 int GetRenderProcessIdFromRenderViewHost(RenderViewHost* host) { |
94 DCHECK(host); | 94 DCHECK(host); |
95 RenderProcessHost* render_process = host->GetProcess(); | 95 RenderProcessHost* render_process = host->GetProcess(); |
96 DCHECK(render_process); | 96 DCHECK(render_process); |
97 if (render_process->HasConnection()) | 97 if (render_process->HasConnection()) |
98 return render_process->GetHandle(); | 98 return render_process->GetHandle(); |
99 else | 99 return 0; |
100 return 0; | |
101 } | 100 } |
102 | 101 |
103 ScopedJavaLocalRef<jobject> CreateJavaRect( | 102 ScopedJavaLocalRef<jobject> CreateJavaRect( |
104 JNIEnv* env, | 103 JNIEnv* env, |
105 const gfx::Rect& rect) { | 104 const gfx::Rect& rect) { |
106 return ScopedJavaLocalRef<jobject>( | 105 return ScopedJavaLocalRef<jobject>( |
107 Java_ContentViewCore_createRect(env, | 106 Java_ContentViewCore_createRect(env, |
108 static_cast<int>(rect.x()), | 107 static_cast<int>(rect.x()), |
109 static_cast<int>(rect.y()), | 108 static_cast<int>(rect.y()), |
110 static_cast<int>(rect.right()), | 109 static_cast<int>(rect.right()), |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 return ScopedJavaLocalRef<jobject>(); | 1451 return ScopedJavaLocalRef<jobject>(); |
1453 | 1452 |
1454 return view->GetJavaObject(); | 1453 return view->GetJavaObject(); |
1455 } | 1454 } |
1456 | 1455 |
1457 bool RegisterContentViewCore(JNIEnv* env) { | 1456 bool RegisterContentViewCore(JNIEnv* env) { |
1458 return RegisterNativesImpl(env); | 1457 return RegisterNativesImpl(env); |
1459 } | 1458 } |
1460 | 1459 |
1461 } // namespace content | 1460 } // namespace content |
OLD | NEW |