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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 web_contents_.reset(content_view_core->GetWebContents()); | 383 web_contents_.reset(content_view_core->GetWebContents()); |
384 AttachTabHelpers(web_contents_.get()); | 384 AttachTabHelpers(web_contents_.get()); |
385 | 385 |
386 SetWindowSessionID(session_window_id_.id()); | 386 SetWindowSessionID(session_window_id_.id()); |
387 | 387 |
388 session_tab_id_.set_id( | 388 session_tab_id_.set_id( |
389 SessionTabHelper::FromWebContents(web_contents())->session_id().id()); | 389 SessionTabHelper::FromWebContents(web_contents())->session_id().id()); |
390 ContextMenuHelper::FromWebContents(web_contents())->SetPopulator( | 390 ContextMenuHelper::FromWebContents(web_contents())->SetPopulator( |
391 jcontext_menu_populator); | 391 jcontext_menu_populator); |
392 ViewAndroidHelper::FromWebContents(web_contents())-> | 392 ViewAndroidHelper::FromWebContents(web_contents())-> |
393 SetViewAndroid(content_view_core); | 393 SetViewAndroid(web_contents()->GetNativeView()); |
394 CoreTabHelper::FromWebContents(web_contents())->set_delegate(this); | 394 CoreTabHelper::FromWebContents(web_contents())->set_delegate(this); |
395 SearchTabHelper::FromWebContents(web_contents())->set_delegate(this); | 395 SearchTabHelper::FromWebContents(web_contents())->set_delegate(this); |
396 web_contents_delegate_.reset( | 396 web_contents_delegate_.reset( |
397 new chrome::android::TabWebContentsDelegateAndroid( | 397 new chrome::android::TabWebContentsDelegateAndroid( |
398 env, jweb_contents_delegate)); | 398 env, jweb_contents_delegate)); |
399 web_contents_delegate_->LoadProgressChanged(web_contents(), 0); | 399 web_contents_delegate_->LoadProgressChanged(web_contents(), 0); |
400 web_contents()->SetDelegate(web_contents_delegate_.get()); | 400 web_contents()->SetDelegate(web_contents_delegate_.get()); |
401 | 401 |
402 notification_registrar_.Add( | 402 notification_registrar_.Add( |
403 this, | 403 this, |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 902 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
903 TRACE_EVENT0("native", "TabAndroid::Init"); | 903 TRACE_EVENT0("native", "TabAndroid::Init"); |
904 // This will automatically bind to the Java object and pass ownership there. | 904 // This will automatically bind to the Java object and pass ownership there. |
905 new TabAndroid(env, obj); | 905 new TabAndroid(env, obj); |
906 } | 906 } |
907 | 907 |
908 // static | 908 // static |
909 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 909 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
910 return RegisterNativesImpl(env); | 910 return RegisterNativesImpl(env); |
911 } | 911 } |
OLD | NEW |