Commit c1590348 authored by evan@chromium.org's avatar evan@chromium.org

Make bookmark_utils::GetNameForURL return a string16.

It is returning Unicode so it should be a string16.
The callers want a string16 anyway.

TEST=compiles

Review URL: http://codereview.chromium.org/6306006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72073 0039d316-1c4b-4281-b951-d872f2087c98
parent f916dc82
...@@ -428,12 +428,12 @@ bool CanPasteFromClipboard(const BookmarkNode* node) { ...@@ -428,12 +428,12 @@ bool CanPasteFromClipboard(const BookmarkNode* node) {
return BookmarkNodeData::ClipboardContainsBookmarks(); return BookmarkNodeData::ClipboardContainsBookmarks();
} }
std::string GetNameForURL(const GURL& url) { string16 GetNameForURL(const GURL& url) {
if (url.is_valid()) { if (url.is_valid()) {
return WideToUTF8(net::GetSuggestedFilename( return WideToUTF16(net::GetSuggestedFilename(
url, std::string(), std::string(), FilePath()).ToWStringHack()); url, std::string(), std::string(), FilePath()).ToWStringHack());
} else { } else {
return l10n_util::GetStringUTF8(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
} }
} }
......
...@@ -115,7 +115,7 @@ bool CanPasteFromClipboard(const BookmarkNode* node); ...@@ -115,7 +115,7 @@ bool CanPasteFromClipboard(const BookmarkNode* node);
// Returns a name for the given URL. Used for drags into bookmark areas when // Returns a name for the given URL. Used for drags into bookmark areas when
// the source doesn't specify a title. // the source doesn't specify a title.
std::string GetNameForURL(const GURL& url); string16 GetNameForURL(const GURL& url);
// Returns a vector containing up to |max_count| of the most recently modified // Returns a vector containing up to |max_count| of the most recently modified
// groups. This never returns an empty vector. // groups. This never returns an empty vector.
......
...@@ -1279,8 +1279,8 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget, ...@@ -1279,8 +1279,8 @@ void BookmarkBarGtk::OnDragReceived(GtkWidget* widget,
// so that it doesn't look like we can drag onto the bookmark bar. // so that it doesn't look like we can drag onto the bookmark bar.
if (!url.is_valid()) if (!url.is_valid())
break; break;
std::string title = bookmark_utils::GetNameForURL(url); string16 title = bookmark_utils::GetNameForURL(url);
model_->AddURL(dest_node, index, UTF8ToUTF16(title), url); model_->AddURL(dest_node, index, title, url);
dnd_success = TRUE; dnd_success = TRUE;
break; break;
} }
......
...@@ -420,8 +420,8 @@ bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data, ...@@ -420,8 +420,8 @@ bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data,
std::vector<GURL> urls; std::vector<GURL> urls;
ui::ExtractURIList(selection_data, &urls); ui::ExtractURIList(selection_data, &urls);
for (size_t i = 0; i < urls.size(); ++i) { for (size_t i = 0; i < urls.size(); ++i) {
std::string title = GetNameForURL(urls[i]); string16 title = GetNameForURL(urls[i]);
model->AddURL(parent, idx++, UTF8ToUTF16(title), urls[i]); model->AddURL(parent, idx++, title, urls[i]);
} }
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment