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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 return result; | 564 return result; |
565 } | 565 } |
566 | 566 |
567 // Creates a historical tab entry from the serialized tab contents contained | 567 // Creates a historical tab entry from the serialized tab contents contained |
568 // within |state|. | 568 // within |state|. |
569 static void CreateHistoricalTab(JNIEnv* env, | 569 static void CreateHistoricalTab(JNIEnv* env, |
570 const JavaParamRef<jclass>& clazz, | 570 const JavaParamRef<jclass>& clazz, |
571 const JavaParamRef<jobject>& state, | 571 const JavaParamRef<jobject>& state, |
572 jint saved_state_version) { | 572 jint saved_state_version) { |
573 std::unique_ptr<WebContents> web_contents(WebContents::FromJavaWebContents( | 573 std::unique_ptr<WebContents> web_contents(WebContents::FromJavaWebContents( |
574 WebContentsState::RestoreContentsFromByteBuffer(env, clazz, state, | 574 WebContentsState::RestoreContentsFromByteBuffer( |
575 saved_state_version, true) | 575 env, clazz, state, saved_state_version, true))); |
576 .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 |