| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |