Index: chrome/browser/android/tab_android.cc |
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc |
index a64861bcca783402094788493bf54c9ac9f299d2..cdffdd5beccb4bd984f9343966e09eb720b9bcec 100644 |
--- a/chrome/browser/android/tab_android.cc |
+++ b/chrome/browser/android/tab_android.cc |
@@ -11,7 +11,11 @@ |
#include "base/memory/ptr_util.h" |
#include "base/metrics/histogram.h" |
#include "base/trace_event/trace_event.h" |
+#include "blimp/client/public/blimp_client_context.h" |
+#include "blimp/client/public/contents/blimp_contents.h" |
+#include "blimp/client/public/contents/blimp_navigation_controller.h" |
#include "cc/layers/layer.h" |
+#include "chrome/browser/android/blimp/blimp_client_context_factory.h" |
#include "chrome/browser/android/compositor/tab_content_manager.h" |
#include "chrome/browser/android/metrics/uma_utils.h" |
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
@@ -29,6 +33,7 @@ |
#include "chrome/browser/printing/print_view_manager_basic.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_android.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/search/instant_service.h" |
#include "chrome/browser/search/instant_service_factory.h" |
#include "chrome/browser/search/search.h" |
@@ -422,6 +427,18 @@ void TabAndroid::InitWebContents( |
content_layer_->InsertChild(web_contents_->GetNativeView()->GetLayer(), 0); |
} |
+void TabAndroid::InitBlimpContents(JNIEnv* env, |
+ const JavaParamRef<jobject>& obj) { |
+ bool incognito = Java_Tab_isIncognito(env, weak_java_tab_.get(env).obj()); |
David Trainor- moved to gerrit
2016/08/18 17:06:30
I don't think we have to bleed this through here.
shaktisahu
2016/08/18 19:36:06
profile->IsOffTheRecord() might not exactly relate
|
+ CHECK(!incognito) << "Cannot create incognito tab in blimp mode."; |
+ |
+ Profile* profile = ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); |
+ blimp::client::BlimpClientContext* context = |
+ BlimpClientContextFactory::GetForBrowserContext(profile); |
+ DCHECK(context); |
+ blimp_contents_ = context->CreateBlimpContents(); |
+} |
+ |
void TabAndroid::UpdateDelegates( |
JNIEnv* env, |
const JavaParamRef<jobject>& obj, |
@@ -500,6 +517,15 @@ base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetProfileAndroid( |
return profile_android->GetJavaObject(); |
} |
+base::android::ScopedJavaLocalRef<jobject> TabAndroid::GetBlimpContents( |
+ JNIEnv* env, |
+ const base::android::JavaParamRef<jobject>& obj) { |
+ if (!blimp_contents_.get()) |
+ return base::android::ScopedJavaLocalRef<jobject>(); |
+ |
+ return blimp_contents_->GetJavaObject(); |
+} |
+ |
TabAndroid::TabLoadStatus TabAndroid::LoadUrl( |
JNIEnv* env, |
const JavaParamRef<jobject>& obj, |
@@ -565,6 +591,11 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl( |
content::RecordAction(base::UserMetricsAction("ShowHistory")); |
} |
+ if (blimp_contents()) { |
+ blimp_contents()->GetNavigationController().LoadURL(fixed_url); |
+ return DEFAULT_PAGE_LOAD; |
+ } |
+ |
content::NavigationController::LoadURLParams load_params(fixed_url); |
if (j_extra_headers) { |
load_params.extra_headers = base::android::ConvertJavaStringToUTF8( |