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

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

Issue 23792002: Set the WindowId of the SessionTabHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Comment Created 7 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/android/tab_model/tab_model_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_android.cc
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index 3fb802787434a78b513ed22084f8ff6a5213843d..0128a4979de3e0d4c7be4648ca8149331c1cda54 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -23,6 +23,8 @@
#include "chrome/browser/sync/glue/synced_tab_delegate_android.h"
#include "chrome/browser/translate/translate_tab_helper.h"
#include "chrome/browser/ui/alternate_error_tab_observer.h"
+#include "chrome/browser/ui/android/tab_model/tab_model.h"
+#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "chrome/browser/ui/android/window_android_helper.h"
#include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h"
#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
@@ -238,6 +240,17 @@ void TabAndroid::InitWebContents(JNIEnv* env,
synced_tab_delegate_->SetWebContents(web_contents());
+ // Set the window ID if there is a valid TabModel.
+ TabModel* model = TabModelList::GetTabModelWithProfile(GetProfile());
+ if (model) {
+ SessionID window_id;
+ window_id.set_id(model->GetSessionId());
+
+ SessionTabHelper* session_tab_helper =
+ SessionTabHelper::FromWebContents(web_contents());
+ session_tab_helper->SetWindowID(window_id);
+ }
+
// Verify that the WebContents this tab represents matches the expected
// off the record state.
CHECK_EQ(GetProfile()->IsOffTheRecord(), incognito);
« no previous file with comments | « no previous file | chrome/browser/ui/android/tab_model/tab_model_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698