| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/tab_state.h" | 5 #include "chrome/browser/android/tab_state.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 std::vector<std::unique_ptr<content::NavigationEntry>> entries = | 433 std::vector<std::unique_ptr<content::NavigationEntry>> entries = |
| 434 sessions::ContentSerializedNavigationBuilder::ToNavigationEntries( | 434 sessions::ContentSerializedNavigationBuilder::ToNavigationEntries( |
| 435 navigations, profile); | 435 navigations, profile); |
| 436 | 436 |
| 437 if (is_off_the_record) | 437 if (is_off_the_record) |
| 438 profile = profile->GetOffTheRecordProfile(); | 438 profile = profile->GetOffTheRecordProfile(); |
| 439 WebContents::CreateParams params(profile); | 439 WebContents::CreateParams params(profile); |
| 440 params.initially_hidden = initially_hidden; | 440 params.initially_hidden = initially_hidden; |
| 441 std::unique_ptr<WebContents> web_contents(WebContents::Create(params)); | 441 std::unique_ptr<WebContents> web_contents(WebContents::Create(params)); |
| 442 web_contents->GetController().Restore( | 442 web_contents->GetController().Restore( |
| 443 current_entry_index, NavigationController::RESTORE_CURRENT_SESSION, | 443 current_entry_index, content::RestoreType::CURRENT_SESSION, &entries); |
| 444 &entries); | |
| 445 return web_contents.release(); | 444 return web_contents.release(); |
| 446 } | 445 } |
| 447 | 446 |
| 448 ScopedJavaLocalRef<jobject> WebContentsState::RestoreContentsFromByteBuffer( | 447 ScopedJavaLocalRef<jobject> WebContentsState::RestoreContentsFromByteBuffer( |
| 449 JNIEnv* env, | 448 JNIEnv* env, |
| 450 jclass clazz, | 449 jclass clazz, |
| 451 jobject state, | 450 jobject state, |
| 452 jint saved_state_version, | 451 jint saved_state_version, |
| 453 jboolean initially_hidden) { | 452 jboolean initially_hidden) { |
| 454 void* data = env->GetDirectBufferAddress(state); | 453 void* data = env->GetDirectBufferAddress(state); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, | 573 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, |
| 575 saved_state_version, true) | 574 saved_state_version, true) |
| 576 .obj())); | 575 .obj())); |
| 577 if (web_contents.get()) | 576 if (web_contents.get()) |
| 578 TabAndroid::CreateHistoricalTabFromContents(web_contents.get()); | 577 TabAndroid::CreateHistoricalTabFromContents(web_contents.get()); |
| 579 } | 578 } |
| 580 | 579 |
| 581 bool RegisterTabState(JNIEnv* env) { | 580 bool RegisterTabState(JNIEnv* env) { |
| 582 return RegisterNativesImpl(env); | 581 return RegisterNativesImpl(env); |
| 583 } | 582 } |
| OLD | NEW |