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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 90 |
91 using base::android::AttachCurrentThread; | 91 using base::android::AttachCurrentThread; |
92 using base::android::ConvertUTF8ToJavaString; | 92 using base::android::ConvertUTF8ToJavaString; |
93 using content::BrowserThread; | 93 using content::BrowserThread; |
94 using content::GlobalRequestID; | 94 using content::GlobalRequestID; |
95 using content::NavigationController; | 95 using content::NavigationController; |
96 using content::WebContents; | 96 using content::WebContents; |
97 using navigation_interception::InterceptNavigationDelegate; | 97 using navigation_interception::InterceptNavigationDelegate; |
98 using navigation_interception::NavigationParams; | 98 using navigation_interception::NavigationParams; |
99 | 99 |
100 TabAndroid* TabAndroid::FromWebContents(content::WebContents* web_contents) { | 100 TabAndroid* TabAndroid::FromWebContents( |
101 CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(web_contents); | 101 const content::WebContents* web_contents) { |
Theresa
2016/06/30 20:50:25
Does this still need to be const or is this left o
xingliu
2016/07/01 00:30:38
Yes.
| |
102 const CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents( | |
103 web_contents); | |
102 if (!core_tab_helper) | 104 if (!core_tab_helper) |
103 return NULL; | 105 return NULL; |
104 | 106 |
105 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); | 107 CoreTabHelperDelegate* core_delegate = core_tab_helper->delegate(); |
106 if (!core_delegate) | 108 if (!core_delegate) |
107 return NULL; | 109 return NULL; |
108 | 110 |
109 return static_cast<TabAndroid*>(core_delegate); | 111 return static_cast<TabAndroid*>(core_delegate); |
110 } | 112 } |
111 | 113 |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
901 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 903 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
902 TRACE_EVENT0("native", "TabAndroid::Init"); | 904 TRACE_EVENT0("native", "TabAndroid::Init"); |
903 // This will automatically bind to the Java object and pass ownership there. | 905 // This will automatically bind to the Java object and pass ownership there. |
904 new TabAndroid(env, obj); | 906 new TabAndroid(env, obj); |
905 } | 907 } |
906 | 908 |
907 // static | 909 // static |
908 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 910 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
909 return RegisterNativesImpl(env); | 911 return RegisterNativesImpl(env); |
910 } | 912 } |
OLD | NEW |