Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: chrome/browser/android/tab_android.cc

Issue 2233023002: Adding BlimpNavigationController to Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nav_handler_remove
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4dc07f68471e47279687e96faefeea4061763cfb 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,14 @@ void TabAndroid::InitWebContents(
content_layer_->InsertChild(web_contents_->GetNativeView()->GetLayer(), 0);
}
+void TabAndroid::InitBlimpContents(JNIEnv* env,
+ const JavaParamRef<jobject>& obj) {
+ blimp::client::BlimpClientContext* context =
+ BlimpClientContextFactory::GetForBrowserContext(
+ ProfileManager::GetLastUsedProfile()->GetOriginalProfile());
David Trainor- moved to gerrit 2016/08/11 21:40:19 Should we fail if this is an incognito tab (for no
shaktisahu 2016/08/12 22:11:49 I discussed with Tommy about this. I added a check
+ blimp_contents_ = context->CreateBlimpContents();
+}
+
void TabAndroid::UpdateDelegates(
JNIEnv* env,
const JavaParamRef<jobject>& obj,
@@ -500,6 +513,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,
@@ -584,6 +606,12 @@ TabAndroid::TabLoadStatus TabAndroid::LoadUrl(
GURL(base::android::ConvertJavaStringToUTF8(env, j_referrer_url)),
static_cast<blink::WebReferrerPolicy>(referrer_policy));
}
+
+ if (blimp_contents()) {
David Trainor- moved to gerrit 2016/08/11 21:40:19 Can we do this before we build the LoadURLParams?
shaktisahu 2016/08/12 22:11:49 Done.
+ blimp_contents()->GetNavigationController().LoadURL(fixed_url);
+ return DEFAULT_PAGE_LOAD;
+ }
+
const base::string16 search_terms =
search::ExtractSearchTermsFromURL(GetProfile(), gurl);
SearchTabHelper* search_tab_helper =

Powered by Google App Engine
This is Rietveld 408576698