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_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 bool did_finish_load) { | 268 bool did_finish_load) { |
269 JNIEnv* env = base::android::AttachCurrentThread(); | 269 JNIEnv* env = base::android::AttachCurrentThread(); |
270 Java_Tab_swapWebContents( | 270 Java_Tab_swapWebContents( |
271 env, | 271 env, |
272 weak_java_tab_.get(env).obj(), | 272 weak_java_tab_.get(env).obj(), |
273 new_contents->GetJavaWebContents().obj(), | 273 new_contents->GetJavaWebContents().obj(), |
274 did_start_load, | 274 did_start_load, |
275 did_finish_load); | 275 did_finish_load); |
276 } | 276 } |
277 | 277 |
| 278 bool TabAndroid::OpenAppBanner(content::WebContents* web_contents) { |
| 279 JNIEnv* env = base::android::AttachCurrentThread(); |
| 280 return Java_Tab_openAppBanner(env, weak_java_tab_.get(env).obj()); |
| 281 } |
| 282 |
278 void TabAndroid::DefaultSearchProviderChanged( | 283 void TabAndroid::DefaultSearchProviderChanged( |
279 bool google_base_url_domain_changed) { | 284 bool google_base_url_domain_changed) { |
280 // TODO(kmadhusu): Move this function definition to a common place and update | 285 // TODO(kmadhusu): Move this function definition to a common place and update |
281 // BrowserInstantController::DefaultSearchProviderChanged to use the same. | 286 // BrowserInstantController::DefaultSearchProviderChanged to use the same. |
282 if (!web_contents()) | 287 if (!web_contents()) |
283 return; | 288 return; |
284 | 289 |
285 InstantService* instant_service = | 290 InstantService* instant_service = |
286 InstantServiceFactory::GetForProfile(GetProfile()); | 291 InstantServiceFactory::GetForProfile(GetProfile()); |
287 if (!instant_service) | 292 if (!instant_service) |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 922 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
918 TRACE_EVENT0("native", "TabAndroid::Init"); | 923 TRACE_EVENT0("native", "TabAndroid::Init"); |
919 // This will automatically bind to the Java object and pass ownership there. | 924 // This will automatically bind to the Java object and pass ownership there. |
920 new TabAndroid(env, obj); | 925 new TabAndroid(env, obj); |
921 } | 926 } |
922 | 927 |
923 // static | 928 // static |
924 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 929 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
925 return RegisterNativesImpl(env); | 930 return RegisterNativesImpl(env); |
926 } | 931 } |
OLD | NEW |