OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/bookmark_utils_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_utils_gtk.h" |
6 | 6 |
7 #include "app/gtk_dnd_util.h" | 7 #include "app/gtk_dnd_util.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return std::vector<const BookmarkNode*>(); | 402 return std::vector<const BookmarkNode*>(); |
403 } | 403 } |
404 | 404 |
405 bool CreateNewBookmarkFromNamedUrl(GtkSelectionData* selection_data, | 405 bool CreateNewBookmarkFromNamedUrl(GtkSelectionData* selection_data, |
406 BookmarkModel* model, const BookmarkNode* parent, int idx) { | 406 BookmarkModel* model, const BookmarkNode* parent, int idx) { |
407 GURL url; | 407 GURL url; |
408 string16 title; | 408 string16 title; |
409 if (!gtk_dnd_util::ExtractNamedURL(selection_data, &url, &title)) | 409 if (!gtk_dnd_util::ExtractNamedURL(selection_data, &url, &title)) |
410 return false; | 410 return false; |
411 | 411 |
412 model->AddURL(parent, idx, UTF16ToWideHack(title), url); | 412 model->AddURL(parent, idx, title, url); |
413 return true; | 413 return true; |
414 } | 414 } |
415 | 415 |
416 bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data, | 416 bool CreateNewBookmarksFromURIList(GtkSelectionData* selection_data, |
417 BookmarkModel* model, const BookmarkNode* parent, int idx) { | 417 BookmarkModel* model, const BookmarkNode* parent, int idx) { |
418 std::vector<GURL> urls; | 418 std::vector<GURL> urls; |
419 gtk_dnd_util::ExtractURIList(selection_data, &urls); | 419 gtk_dnd_util::ExtractURIList(selection_data, &urls); |
420 for (size_t i = 0; i < urls.size(); ++i) { | 420 for (size_t i = 0; i < urls.size(); ++i) { |
421 std::string title = GetNameForURL(urls[i]); | 421 std::string title = GetNameForURL(urls[i]); |
422 model->AddURL(parent, idx++, UTF8ToWide(title), urls[i]); | 422 model->AddURL(parent, idx++, UTF8ToUTF16(title), urls[i]); |
423 } | 423 } |
424 return true; | 424 return true; |
425 } | 425 } |
426 | 426 |
427 } // namespace bookmark_utils | 427 } // namespace bookmark_utils |
OLD | NEW |