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

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

Issue 774183004: Upstream historical tab logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upstreaming_2
Patch Set: Created 6 years 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_state.cc
diff --git a/chrome/browser/android/tab_state.cc b/chrome/browser/android/tab_state.cc
index afa6269988b5f9d5df6945e934189f58e61c1749..fc5745f96211ed9a96288486f42e49038f6b22f0 100644
--- a/chrome/browser/android/tab_state.cc
+++ b/chrome/browser/android/tab_state.cc
@@ -17,12 +17,14 @@
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/common/url_constants.h"
#include "components/sessions/content/content_serialized_navigation_builder.h"
#include "components/sessions/serialized_navigation_entry.h"
#include "components/sessions/session_command.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/url_constants.h"
#include "jni/TabState_jni.h"
using base::android::ConvertUTF16ToJavaString;
@@ -551,6 +553,22 @@ static jstring GetVirtualUrlFromByteBuffer(JNIEnv* env,
return result.Release();
}
+// Creates a historical tab entry from the serialized tab contents contained
+// within |state|.
+static void CreateHistoricalTab(JNIEnv* env,
+ jclass clazz,
+ jobject state,
+ jint saved_state_version) {
+ scoped_ptr<WebContents> web_contents(
+ WebContentsState::RestoreContentsFromByteBuffer(env,
+ clazz,
+ state,
+ saved_state_version,
+ true));
+ if (web_contents.get())
+ TabAndroid::CreateHistoricalTabFromContents(web_contents.get());
+}
+
bool RegisterTabState(JNIEnv* env) {
return RegisterNativesImpl(env);
}
« chrome/browser/android/tab_android.cc ('K') | « chrome/browser/android/tab_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698