| 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/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "content/browser/tab_contents/navigation_controller.h" | 9 #include "content/browser/tab_contents/navigation_controller.h" |
| 10 #include "content/browser/tab_contents/navigation_entry.h" | 10 #include "content/browser/tab_contents/navigation_entry.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Profile *profile) const { | 61 Profile *profile) const { |
| 62 NavigationEntry* entry = NavigationController::CreateNavigationEntry( | 62 NavigationEntry* entry = NavigationController::CreateNavigationEntry( |
| 63 virtual_url_, | 63 virtual_url_, |
| 64 referrer_, | 64 referrer_, |
| 65 // Use a transition type of reload so that we don't incorrectly | 65 // Use a transition type of reload so that we don't incorrectly |
| 66 // increase the typed count. | 66 // increase the typed count. |
| 67 PageTransition::RELOAD, | 67 PageTransition::RELOAD, |
| 68 profile); | 68 profile); |
| 69 | 69 |
| 70 entry->set_page_id(page_id); | 70 entry->set_page_id(page_id); |
| 71 // TODO(evan): use directionality of title. | 71 entry->set_title(title_); |
| 72 // http://code.google.com/p/chromium/issues/detail?id=27094 | |
| 73 entry->set_title( | |
| 74 base::i18n::String16WithDirection(title_, base::i18n::LEFT_TO_RIGHT)); | |
| 75 entry->set_content_state(state_); | 72 entry->set_content_state(state_); |
| 76 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); | 73 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); |
| 77 | 74 |
| 78 return entry; | 75 return entry; |
| 79 } | 76 } |
| 80 | 77 |
| 81 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { | 78 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { |
| 82 virtual_url_ = entry.virtual_url(); | 79 virtual_url_ = entry.virtual_url(); |
| 83 referrer_ = entry.referrer(); | 80 referrer_ = entry.referrer(); |
| 84 // TODO(evan): use directionality of title. | 81 title_ = entry.title(); |
| 85 // http://code.google.com/p/chromium/issues/detail?id=27094 | |
| 86 title_ = entry.title().string(); | |
| 87 state_ = entry.content_state(); | 82 state_ = entry.content_state(); |
| 88 transition_ = entry.transition_type(); | 83 transition_ = entry.transition_type(); |
| 89 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; | 84 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; |
| 90 } | 85 } |
| 91 | 86 |
| 92 // SessionTab ----------------------------------------------------------------- | 87 // SessionTab ----------------------------------------------------------------- |
| 93 | 88 |
| 94 SessionTab::SessionTab() | 89 SessionTab::SessionTab() |
| 95 : tab_visual_index(-1), | 90 : tab_visual_index(-1), |
| 96 current_navigation_index(-1), | 91 current_navigation_index(-1), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 115 | 110 |
| 116 // ForeignSession -------------------------------------------------------------- | 111 // ForeignSession -------------------------------------------------------------- |
| 117 | 112 |
| 118 ForeignSession::ForeignSession() : foreign_session_tag("invalid") { | 113 ForeignSession::ForeignSession() : foreign_session_tag("invalid") { |
| 119 } | 114 } |
| 120 | 115 |
| 121 ForeignSession::~ForeignSession() { | 116 ForeignSession::~ForeignSession() { |
| 122 STLDeleteElements(&windows); | 117 STLDeleteElements(&windows); |
| 123 } | 118 } |
| 124 | 119 |
| OLD | NEW |