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

Side by Side Diff: chrome/browser/sessions/session_types.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
« no previous file with comments | « chrome/browser/sessions/session_service_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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
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 entry->set_title(title_); 71 // TODO(evan): use directionality of 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));
72 entry->set_content_state(state_); 75 entry->set_content_state(state_);
73 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA); 76 entry->set_has_post_data(type_mask_ & TabNavigation::HAS_POST_DATA);
74 77
75 return entry; 78 return entry;
76 } 79 }
77 80
78 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) { 81 void TabNavigation::SetFromNavigationEntry(const NavigationEntry& entry) {
79 virtual_url_ = entry.virtual_url(); 82 virtual_url_ = entry.virtual_url();
80 referrer_ = entry.referrer(); 83 referrer_ = entry.referrer();
81 title_ = entry.title(); 84 // TODO(evan): use directionality of title.
85 // http://code.google.com/p/chromium/issues/detail?id=27094
86 title_ = entry.title().string();
82 state_ = entry.content_state(); 87 state_ = entry.content_state();
83 transition_ = entry.transition_type(); 88 transition_ = entry.transition_type();
84 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0; 89 type_mask_ = entry.has_post_data() ? TabNavigation::HAS_POST_DATA : 0;
85 } 90 }
86 91
87 // SessionTab ----------------------------------------------------------------- 92 // SessionTab -----------------------------------------------------------------
88 93
89 SessionTab::SessionTab() 94 SessionTab::SessionTab()
90 : tab_visual_index(-1), 95 : tab_visual_index(-1),
91 current_navigation_index(-1), 96 current_navigation_index(-1),
(...skipping 18 matching lines...) Expand all
110 115
111 // ForeignSession -------------------------------------------------------------- 116 // ForeignSession --------------------------------------------------------------
112 117
113 ForeignSession::ForeignSession() : foreign_session_tag("invalid") { 118 ForeignSession::ForeignSession() : foreign_session_tag("invalid") {
114 } 119 }
115 120
116 ForeignSession::~ForeignSession() { 121 ForeignSession::~ForeignSession() {
117 STLDeleteElements(&windows); 122 STLDeleteElements(&windows);
118 } 123 }
119 124
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_service_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698