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

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

Issue 6306006: Make bookmark_utils::GetNameForURL return a string16. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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/bookmarks/bookmark_utils.h ('k') | chrome/browser/ui/gtk/bookmark_bar_gtk.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) 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/bookmarks/bookmark_utils.h" 5 #include "chrome/browser/bookmarks/bookmark_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 bookmark_utils::CloneBookmarkNode( 421 bookmark_utils::CloneBookmarkNode(
422 model, bookmark_data.elements, parent, index); 422 model, bookmark_data.elements, parent, index);
423 } 423 }
424 424
425 bool CanPasteFromClipboard(const BookmarkNode* node) { 425 bool CanPasteFromClipboard(const BookmarkNode* node) {
426 if (!node) 426 if (!node)
427 return false; 427 return false;
428 return BookmarkNodeData::ClipboardContainsBookmarks(); 428 return BookmarkNodeData::ClipboardContainsBookmarks();
429 } 429 }
430 430
431 std::string GetNameForURL(const GURL& url) { 431 string16 GetNameForURL(const GURL& url) {
432 if (url.is_valid()) { 432 if (url.is_valid()) {
433 return WideToUTF8(net::GetSuggestedFilename( 433 return WideToUTF16(net::GetSuggestedFilename(
434 url, std::string(), std::string(), FilePath()).ToWStringHack()); 434 url, std::string(), std::string(), FilePath()).ToWStringHack());
435 } else { 435 } else {
436 return l10n_util::GetStringUTF8(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); 436 return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
437 } 437 }
438 } 438 }
439 439
440 std::vector<const BookmarkNode*> GetMostRecentlyModifiedGroups( 440 std::vector<const BookmarkNode*> GetMostRecentlyModifiedGroups(
441 BookmarkModel* model, 441 BookmarkModel* model,
442 size_t max_count) { 442 size_t max_count) {
443 std::vector<const BookmarkNode*> nodes; 443 std::vector<const BookmarkNode*> nodes;
444 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); 444 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node());
445 while (iterator.has_next()) { 445 while (iterator.has_next()) {
446 const BookmarkNode* parent = iterator.Next(); 446 const BookmarkNode* parent = iterator.Next();
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 return true; 662 return true;
663 663
664 for (int i = 0; i < node->GetChildCount(); ++i) { 664 for (int i = 0; i < node->GetChildCount(); ++i) {
665 if (NodeHasURLs(node->GetChild(i))) 665 if (NodeHasURLs(node->GetChild(i)))
666 return true; 666 return true;
667 } 667 }
668 return false; 668 return false;
669 } 669 }
670 670
671 } // namespace bookmark_utils 671 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.h ('k') | chrome/browser/ui/gtk/bookmark_bar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698