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

Side by Side Diff: chrome/browser/ui/gtk/bookmark_utils_gtk.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/ui/gtk/bookmark_bar_gtk.cc ('k') | no next file » | 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/ui/gtk/bookmark_utils_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmark_utils_gtk.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 model->AddURL(parent, idx, title, url); 414 model->AddURL(parent, idx, title, url);
415 return true; 415 return true;
416 } 416 }
417 417
418 bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data, 418 bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data,
419 BookmarkModel* model, const BookmarkNode* parent, int idx) { 419 BookmarkModel* model, const BookmarkNode* parent, int idx) {
420 std::vector<GURL> urls; 420 std::vector<GURL> urls;
421 ui::ExtractURIList(selection_data, &urls); 421 ui::ExtractURIList(selection_data, &urls);
422 for (size_t i = 0; i < urls.size(); ++i) { 422 for (size_t i = 0; i < urls.size(); ++i) {
423 std::string title = GetNameForURL(urls[i]); 423 string16 title = GetNameForURL(urls[i]);
424 model->AddURL(parent, idx++, UTF8ToUTF16(title), urls[i]); 424 model->AddURL(parent, idx++, title, urls[i]);
425 } 425 }
426 return true; 426 return true;
427 } 427 }
428 428
429 bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data, 429 bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data,
430 BookmarkModel* model, const BookmarkNode* parent, int idx) { 430 BookmarkModel* model, const BookmarkNode* parent, int idx) {
431 GURL url; 431 GURL url;
432 string16 title; 432 string16 title;
433 if (!ui::ExtractNetscapeURL(selection_data, &url, &title)) 433 if (!ui::ExtractNetscapeURL(selection_data, &url, &title))
434 return false; 434 return false;
435 435
436 model->AddURL(parent, idx, title, url); 436 model->AddURL(parent, idx, title, url);
437 return true; 437 return true;
438 } 438 }
439 439
440 } // namespace bookmark_utils 440 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmark_bar_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698