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

Side by Side Diff: chrome/browser/sessions/session_service_unittest.cc

Issue 6894009: Change NavigationEntry's title fields to carry the text direction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 8 months 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
OLDNEW
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
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 entry.set_title(navigation.title()); 74 // TODO(evan): use directionality of 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));
75 entry.set_content_state(navigation.state()); 79 entry.set_content_state(navigation.state());
76 entry.set_transition_type(navigation.transition()); 80 entry.set_transition_type(navigation.transition());
77 entry.set_has_post_data( 81 entry.set_has_post_data(
78 navigation.type_mask() & TabNavigation::HAS_POST_DATA); 82 navigation.type_mask() & TabNavigation::HAS_POST_DATA);
79 service()->UpdateTabNavigation(window_id, tab_id, index, entry); 83 service()->UpdateTabNavigation(window_id, tab_id, index, entry);
80 if (select) 84 if (select)
81 service()->SetSelectedNavigationIndex(window_id, tab_id, index); 85 service()->SetSelectedNavigationIndex(window_id, tab_id, index);
82 } 86 }
83 87
84 void ReadWindows(std::vector<SessionWindow*>* windows) { 88 void ReadWindows(std::vector<SessionWindow*>* windows) {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 661
658 helper_.PrepareTabInWindow(window_id, tab_id, 0, true); 662 helper_.PrepareTabInWindow(window_id, tab_id, 0, true);
659 UpdateNavigation(window_id, tab_id, nav1, 0, true); 663 UpdateNavigation(window_id, tab_id, nav1, 0, true);
660 service()->TabClosed(window_id, tab_id, true); 664 service()->TabClosed(window_id, tab_id, true);
661 665
662 ScopedVector<SessionWindow> windows; 666 ScopedVector<SessionWindow> windows;
663 ReadWindows(&(windows.get())); 667 ReadWindows(&(windows.get()));
664 668
665 ASSERT_TRUE(windows->empty()); 669 ASSERT_TRUE(windows->empty());
666 } 670 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/base_session_service.cc ('k') | chrome/browser/sessions/session_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698