| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sessions/session_types.h" | 5 #include "chrome/browser/sessions/session_types.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "content/browser/tab_contents/navigation_controller.h" | 10 #include "content/browser/tab_contents/navigation_controller.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 NavigationEntry* TabNavigation::ToNavigationEntry(int page_id, | 61 NavigationEntry* TabNavigation::ToNavigationEntry(int page_id, |
| 62 Profile *profile) const { | 62 Profile *profile) const { |
| 63 NavigationEntry* entry = NavigationController::CreateNavigationEntry( | 63 NavigationEntry* entry = NavigationController::CreateNavigationEntry( |
| 64 virtual_url_, | 64 virtual_url_, |
| 65 referrer_, | 65 referrer_, |
| 66 // Use a transition type of reload so that we don't incorrectly | 66 // Use a transition type of reload so that we don't incorrectly |
| 67 // increase the typed count. | 67 // increase the typed count. |
| 68 PageTransition::RELOAD, | 68 PageTransition::RELOAD, |
| 69 extra_headers_, |
| 69 profile); | 70 profile); |
| 70 | 71 |
| 71 entry->set_page_id(page_id); | 72 entry->set_page_id(page_id); |
| 72 entry->set_title(title_); | 73 entry->set_title(title_); |
| 73 entry->set_content_state(state_); | 74 entry->set_content_state(state_); |
| 74 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); | 75 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); |
| 75 | 76 |
| 76 return entry; | 77 return entry; |
| 77 } | 78 } |
| 78 | 79 |
| 79 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { | 80 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { |
| 80 virtual_url_ = entry.virtual_url(); | 81 virtual_url_ = entry.virtual_url(); |
| 81 referrer_ = entry.referrer(); | 82 referrer_ = entry.referrer(); |
| 82 title_ = entry.title(); | 83 title_ = entry.title(); |
| 83 state_ = entry.content_state(); | 84 state_ = entry.content_state(); |
| 84 transition_ = entry.transition_type(); | 85 transition_ = entry.transition_type(); |
| 85 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; | 86 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; |
| 87 extra_headers_ = entry.extra_headers(); |
| 86 } | 88 } |
| 87 | 89 |
| 88 // static | 90 // static |
| 89 void TabNavigation::CreateNavigationEntriesFromTabNavigations( | 91 void TabNavigation::CreateNavigationEntriesFromTabNavigations( |
| 90 Profile* profile, | 92 Profile* profile, |
| 91 const std::vector<TabNavigation>& navigations, | 93 const std::vector<TabNavigation>& navigations, |
| 92 std::vector<NavigationEntry*>* entries) { | 94 std::vector<NavigationEntry*>* entries) { |
| 93 int page_id = 0; | 95 int page_id = 0; |
| 94 for (std::vector<TabNavigation>::const_iterator i = | 96 for (std::vector<TabNavigation>::const_iterator i = |
| 95 navigations.begin(); i != navigations.end(); ++i, ++page_id) { | 97 navigations.begin(); i != navigations.end(); ++i, ++page_id) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 123 | 125 |
| 124 // SyncedSession -------------------------------------------------------------- | 126 // SyncedSession -------------------------------------------------------------- |
| 125 | 127 |
| 126 SyncedSession::SyncedSession() : session_tag("invalid") { | 128 SyncedSession::SyncedSession() : session_tag("invalid") { |
| 127 } | 129 } |
| 128 | 130 |
| 129 SyncedSession::~SyncedSession() { | 131 SyncedSession::~SyncedSession() { |
| 130 STLDeleteElements(&windows); | 132 STLDeleteElements(&windows); |
| 131 } | 133 } |
| 132 | 134 |
| OLD | NEW |