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" |
11 #include "content/browser/tab_contents/navigation_entry.h" | 11 #include "content/browser/tab_contents/navigation_entry.h" |
12 | 12 |
13 // TabNavigation -------------------------------------------------------------- | 13 // TabNavigation -------------------------------------------------------------- |
14 | 14 |
15 TabNavigation::TabNavigation() | 15 TabNavigation::TabNavigation() |
16 : transition_(PageTransition::TYPED), | 16 : transition_(content::PAGE_TRANSITION_TYPED), |
17 type_mask_(0), | 17 type_mask_(0), |
18 index_(-1) { | 18 index_(-1) { |
19 } | 19 } |
20 | 20 |
21 TabNavigation::TabNavigation(int index, | 21 TabNavigation::TabNavigation(int index, |
22 const GURL& virtual_url, | 22 const GURL& virtual_url, |
23 const GURL& referrer, | 23 const GURL& referrer, |
24 const string16& title, | 24 const string16& title, |
25 const std::string& state, | 25 const std::string& state, |
26 PageTransition::Type transition) | 26 content::PageTransition transition) |
27 : virtual_url_(virtual_url), | 27 : virtual_url_(virtual_url), |
28 referrer_(referrer), | 28 referrer_(referrer), |
29 title_(title), | 29 title_(title), |
30 state_(state), | 30 state_(state), |
31 transition_(transition), | 31 transition_(transition), |
32 type_mask_(0), | 32 type_mask_(0), |
33 index_(index) { | 33 index_(index) { |
34 } | 34 } |
35 | 35 |
36 TabNavigation::TabNavigation(const TabNavigation& tab) | 36 TabNavigation::TabNavigation(const TabNavigation& tab) |
(...skipping 21 matching lines...) Expand all Loading... |
58 } | 58 } |
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 content::PAGE_TRANSITION_RELOAD, |
69 // The extra headers are not sync'ed across sessions. | 69 // The extra headers are not sync'ed across sessions. |
70 std::string(), | 70 std::string(), |
71 profile); | 71 profile); |
72 | 72 |
73 entry->set_page_id(page_id); | 73 entry->set_page_id(page_id); |
74 entry->set_title(title_); | 74 entry->set_title(title_); |
75 entry->set_content_state(state_); | 75 entry->set_content_state(state_); |
76 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); | 76 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); |
77 | 77 |
78 return entry; | 78 return entry; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 SessionWindow::SessionWindow() | 115 SessionWindow::SessionWindow() |
116 : selected_tab_index(-1), | 116 : selected_tab_index(-1), |
117 type(Browser::TYPE_TABBED), | 117 type(Browser::TYPE_TABBED), |
118 is_constrained(true), | 118 is_constrained(true), |
119 show_state(ui::SHOW_STATE_DEFAULT) { | 119 show_state(ui::SHOW_STATE_DEFAULT) { |
120 } | 120 } |
121 | 121 |
122 SessionWindow::~SessionWindow() { | 122 SessionWindow::~SessionWindow() { |
123 STLDeleteElements(&tabs); | 123 STLDeleteElements(&tabs); |
124 } | 124 } |
OLD | NEW |