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

Side by Side Diff: chrome/browser/android/recently_closed_tabs_bridge.cc

Issue 36473002: Foreign session pages now load into current tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar owners Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/recently_closed_tabs_bridge.h" 5 #include "chrome/browser/android/recently_closed_tabs_bridge.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "chrome/browser/android/tab_android.h" 8 #include "chrome/browser/android/tab_android.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_android.h" 10 #include "chrome/browser/profiles/profile_android.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 if (!web_contents) 106 if (!web_contents)
107 return false; 107 return false;
108 108
109 // RestoreForeignSessionTab needs a SessionTab. 109 // RestoreForeignSessionTab needs a SessionTab.
110 SessionTab session_tab; 110 SessionTab session_tab;
111 session_tab.current_navigation_index = tab_entry->current_navigation_index; 111 session_tab.current_navigation_index = tab_entry->current_navigation_index;
112 session_tab.navigations = tab_entry->navigations; 112 session_tab.navigations = tab_entry->navigations;
113 113
114 SessionRestore::RestoreForeignSessionTab(web_contents, 114 SessionRestore::RestoreForeignSessionTab(web_contents,
115 session_tab, 115 session_tab,
116 NEW_FOREGROUND_TAB); 116 CURRENT_TAB);
nyquist 2013/11/04 18:36:08 Mention this change in the CL description.
apiccion 2013/11/04 18:44:03 Done.
117 return true; 117 return true;
118 } 118 }
119 119
120 void RecentlyClosedTabsBridge::ClearRecentlyClosedTabs(JNIEnv* env, 120 void RecentlyClosedTabsBridge::ClearRecentlyClosedTabs(JNIEnv* env,
121 jobject obj) { 121 jobject obj) {
122 EnsureTabRestoreService(); 122 EnsureTabRestoreService();
123 if (tab_restore_service_) 123 if (tab_restore_service_)
124 tab_restore_service_->ClearEntries(); 124 tab_restore_service_->ClearEntries();
125 } 125 }
126 126
(...skipping 29 matching lines...) Expand all
156 static jint Init(JNIEnv* env, jobject obj, jobject jprofile) { 156 static jint Init(JNIEnv* env, jobject obj, jobject jprofile) {
157 RecentlyClosedTabsBridge* bridge = new RecentlyClosedTabsBridge( 157 RecentlyClosedTabsBridge* bridge = new RecentlyClosedTabsBridge(
158 ProfileAndroid::FromProfileAndroid(jprofile)); 158 ProfileAndroid::FromProfileAndroid(jprofile));
159 return reinterpret_cast<jint>(bridge); 159 return reinterpret_cast<jint>(bridge);
160 } 160 }
161 161
162 // static 162 // static
163 bool RecentlyClosedTabsBridge::Register(JNIEnv* env) { 163 bool RecentlyClosedTabsBridge::Register(JNIEnv* env) {
164 return RegisterNativesImpl(env); 164 return RegisterNativesImpl(env);
165 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698