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

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

Issue 2088443003: Shortcut ctrl+shift+T added on android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set window id for android into TabRestoreService::Tab.browser_id, to select the correct android tab… Created 4 years, 6 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 efd00c4aaab7e2cf4591d60c291f952945b7cf13..25035d694f921d0e285d0e3d881e149f37c5b22f 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -708,6 +708,15 @@ void TabAndroid::CreateHistoricalTabFromContents(WebContents* web_contents) {
// TODO(jcivelli): is the index important?
service->CreateHistoricalTab(
sessions::ContentLiveTab::GetForWebContents(web_contents), -1);
+
+ // write android tab window id into TabRestoreService::Tab.browser_id.
+ if (!service->entries().empty()) {
+ TabAndroid* tab_android = TabAndroid::FromWebContents(web_contents);
+ using RestoreTab = sessions::TabRestoreService::Tab;
+ RestoreTab* restore_tab =
+ static_cast<RestoreTab*>(service->GetMostRecentEntry());
+ restore_tab->browser_id = tab_android->window_id().id();
+ }
}
void TabAndroid::CreateHistoricalTab(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698