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

Side by Side Diff: android_webview/native/state_serializer.cc

Issue 11428070: Some required fixes for HTMLViewer rotate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix title callback. Merge new test intol existing title test. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "android_webview/native/state_serializer.h" 5 #include "android_webview/native/state_serializer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return false; 91 return false;
92 if (selected_entry >= entry_count) 92 if (selected_entry >= entry_count)
93 return false; 93 return false;
94 94
95 ScopedVector<content::NavigationEntry> restored_entries; 95 ScopedVector<content::NavigationEntry> restored_entries;
96 for (int i = 0; i < entry_count; ++i) { 96 for (int i = 0; i < entry_count; ++i) {
97 restored_entries.push_back(content::NavigationEntry::Create()); 97 restored_entries.push_back(content::NavigationEntry::Create());
98 if (!internal::RestoreNavigationEntryFromPickle(iterator, 98 if (!internal::RestoreNavigationEntryFromPickle(iterator,
99 restored_entries[i])) 99 restored_entries[i]))
100 return false; 100 return false;
101
102 restored_entries[i]->SetPageID(i);
101 } 103 }
102 104
103 // |web_contents| takes ownership of these entries after this call. 105 // |web_contents| takes ownership of these entries after this call.
104 web_contents->GetController().Restore( 106 web_contents->GetController().Restore(
105 selected_entry, 107 selected_entry,
106 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, 108 content::NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
107 &restored_entries.get()); 109 &restored_entries.get());
108 DCHECK_EQ(0u, restored_entries.size()); 110 DCHECK_EQ(0u, restored_entries.size());
109 111
110 return true; 112 return true;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return false; 248 return false;
247 entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); 249 entry->SetTimestamp(base::Time::FromInternalValue(timestamp));
248 } 250 }
249 251
250 return true; 252 return true;
251 } 253 }
252 254
253 } // namespace internal 255 } // namespace internal
254 256
255 } // namespace android_webview 257 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698