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

Side by Side Diff: chrome/browser/bookmarks/bookmark_table_model.cc

Issue 372017: Fix various problems with inline autocomplete and URLs that change length dur... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/bookmarks/bookmark_table_model.h" 5 #include "chrome/browser/bookmarks/bookmark_table_model.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
11 #include "app/table_model_observer.h" 11 #include "app/table_model_observer.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 l10n_util::AdjustStringForLocaleDirection(title, &title); 317 l10n_util::AdjustStringForLocaleDirection(title, &title);
318 return title; 318 return title;
319 } 319 }
320 320
321 case IDS_BOOKMARK_TABLE_URL: { 321 case IDS_BOOKMARK_TABLE_URL: {
322 if (!node->is_url()) 322 if (!node->is_url())
323 return std::wstring(); 323 return std::wstring();
324 std::wstring languages = model_ && model_->profile() 324 std::wstring languages = model_ && model_->profile()
325 ? model_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages) 325 ? model_->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)
326 : std::wstring(); 326 : std::wstring();
327 std::wstring url_text = 327 std::wstring url_text = net::FormatUrl(node->GetURL(), languages, false,
328 net::FormatUrl(node->GetURL(), languages, false, UnescapeRule::SPACES, 328 UnescapeRule::SPACES, NULL, NULL, NULL);
329 NULL, NULL);
330 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) 329 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
331 l10n_util::WrapStringWithLTRFormatting(&url_text); 330 l10n_util::WrapStringWithLTRFormatting(&url_text);
332 return url_text; 331 return url_text;
333 } 332 }
334 333
335 case IDS_BOOKMARK_TABLE_PATH: { 334 case IDS_BOOKMARK_TABLE_PATH: {
336 std::wstring path; 335 std::wstring path;
337 BuildPath(node->GetParent(), &path); 336 BuildPath(node->GetParent(), &path);
338 // Force path to have LTR directionality. The whole path (but not every 337 // Force path to have LTR directionality. The whole path (but not every
339 // single path component) is marked with LRE-PDF. For example, 338 // single path component) is marked with LRE-PDF. For example,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return; 402 return;
404 } 403 }
405 if (node == model()->other_node()) { 404 if (node == model()->other_node()) {
406 *path = l10n_util::GetString(IDS_BOOKMARK_TABLE_OTHER_BOOKMARKS_PATH); 405 *path = l10n_util::GetString(IDS_BOOKMARK_TABLE_OTHER_BOOKMARKS_PATH);
407 return; 406 return;
408 } 407 }
409 BuildPath(node->GetParent(), path); 408 BuildPath(node->GetParent(), path);
410 path->append(l10n_util::GetString(IDS_BOOKMARK_TABLE_PATH_SEPARATOR)); 409 path->append(l10n_util::GetString(IDS_BOOKMARK_TABLE_PATH_SEPARATOR));
411 path->append(node->GetTitle()); 410 path->append(node->GetTitle());
412 } 411 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698