| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/memory/scoped_temp_dir.h" | 8 #include "base/memory/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 | 65 |
| 66 void UpdateNavigation(const SessionID& window_id, | 66 void UpdateNavigation(const SessionID& window_id, |
| 67 const SessionID& tab_id, | 67 const SessionID& tab_id, |
| 68 const TabNavigation& navigation, | 68 const TabNavigation& navigation, |
| 69 int index, | 69 int index, |
| 70 bool select) { | 70 bool select) { |
| 71 NavigationEntry entry; | 71 NavigationEntry entry; |
| 72 entry.set_url(navigation.virtual_url()); | 72 entry.set_url(navigation.virtual_url()); |
| 73 entry.set_referrer(navigation.referrer()); | 73 entry.set_referrer(navigation.referrer()); |
| 74 // TODO(evan): use directionality of title. | 74 entry.set_title(navigation.title()); |
| 75 // http://code.google.com/p/chromium/issues/detail?id=27094 | |
| 76 entry.set_title( | |
| 77 base::i18n::String16WithDirection(navigation.title(), | |
| 78 base::i18n::LEFT_TO_RIGHT)); | |
| 79 entry.set_content_state(navigation.state()); | 75 entry.set_content_state(navigation.state()); |
| 80 entry.set_transition_type(navigation.transition()); | 76 entry.set_transition_type(navigation.transition()); |
| 81 entry.set_has_post_data( | 77 entry.set_has_post_data( |
| 82 navigation.type_mask() & TabNavigation::HAS_POST_DATA); | 78 navigation.type_mask() & TabNavigation::HAS_POST_DATA); |
| 83 service()->UpdateTabNavigation(window_id, tab_id, index, entry); | 79 service()->UpdateTabNavigation(window_id, tab_id, index, entry); |
| 84 if (select) | 80 if (select) |
| 85 service()->SetSelectedNavigationIndex(window_id, tab_id, index); | 81 service()->SetSelectedNavigationIndex(window_id, tab_id, index); |
| 86 } | 82 } |
| 87 | 83 |
| 88 void ReadWindows(std::vector<SessionWindow*>* windows) { | 84 void ReadWindows(std::vector<SessionWindow*>* windows) { |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 657 |
| 662 helper_.PrepareTabInWindow(window_id, tab_id, 0, true); | 658 helper_.PrepareTabInWindow(window_id, tab_id, 0, true); |
| 663 UpdateNavigation(window_id, tab_id, nav1, 0, true); | 659 UpdateNavigation(window_id, tab_id, nav1, 0, true); |
| 664 service()->TabClosed(window_id, tab_id, true); | 660 service()->TabClosed(window_id, tab_id, true); |
| 665 | 661 |
| 666 ScopedVector<SessionWindow> windows; | 662 ScopedVector<SessionWindow> windows; |
| 667 ReadWindows(&(windows.get())); | 663 ReadWindows(&(windows.get())); |
| 668 | 664 |
| 669 ASSERT_TRUE(windows->empty()); | 665 ASSERT_TRUE(windows->empty()); |
| 670 } | 666 } |
| OLD | NEW |