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