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 "chrome/browser/android/tab_android.h" | 5 #include "chrome/browser/android/tab_android.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_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 using base::android::AttachCurrentThread; | 92 using base::android::AttachCurrentThread; |
93 using base::android::ConvertUTF8ToJavaString; | 93 using base::android::ConvertUTF8ToJavaString; |
94 using content::BrowserThread; | 94 using content::BrowserThread; |
95 using content::GlobalRequestID; | 95 using content::GlobalRequestID; |
96 using content::NavigationController; | 96 using content::NavigationController; |
97 using content::WebContents; | 97 using content::WebContents; |
98 using navigation_interception::InterceptNavigationDelegate; | 98 using navigation_interception::InterceptNavigationDelegate; |
99 using navigation_interception::NavigationParams; | 99 using navigation_interception::NavigationParams; |
100 | 100 |
101 TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) { | 101 TabAndroid* TabAndroid::FromWebContents( |
102 CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(web_contents); | 102 const content::WebContents* web_contents) { |
| 103 const CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents( |
| 104 web_contents); |
103 if (!core_tab_helper) | 105 if (!core_tab_helper) |
104 return NULL; | 106 return NULL; |
105 | 107 |
106 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); | 108 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); |
107 if (!core_delegate) | 109 if (!core_delegate) |
108 return NULL; | 110 return NULL; |
109 | 111 |
110 return static_cast<TabAndroid*>(core_delegate); | 112 return static_cast<TabAndroid*>(core_delegate); |
111 } | 113 } |
112 | 114 |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 904 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
903 TRACE_EVENT0("native", "TabAndroid::Init"); | 905 TRACE_EVENT0("native", "TabAndroid::Init"); |
904 // This will automatically bind to the Java object and pass ownership there. | 906 // This will automatically bind to the Java object and pass ownership there. |
905 new TabAndroid(env, obj); | 907 new TabAndroid(env, obj); |
906 } | 908 } |
907 | 909 |
908 // static | 910 // static |
909 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 911 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
910 return RegisterNativesImpl(env); | 912 return RegisterNativesImpl(env); |
911 } | 913 } |
OLD | NEW |