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

Side by Side Diff: chrome/browser/gtk/bookmark_utils_gtk.cc

Issue 5292013: GTK: Parse NETSCAPE_URL types in drags to the bookmark bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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
« app/gtk_dnd_util.cc ('K') | « chrome/browser/gtk/bookmark_utils_gtk.h ('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) 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 BookmarkModel* model, const BookmarkNode* parent, int idx) { 420 BookmarkModel* model, const BookmarkNode* parent, int idx) {
421 std::vector<GURL> urls; 421 std::vector<GURL> urls;
422 gtk_dnd_util::ExtractURIList(selection_data, &urls); 422 gtk_dnd_util::ExtractURIList(selection_data, &urls);
423 for (size_t i = 0; i < urls.size(); ++i) { 423 for (size_t i = 0; i < urls.size(); ++i) {
424 std::string title = GetNameForURL(urls[i]); 424 std::string title = GetNameForURL(urls[i]);
425 model->AddURL(parent, idx++, UTF8ToUTF16(title), urls[i]); 425 model->AddURL(parent, idx++, UTF8ToUTF16(title), urls[i]);
426 } 426 }
427 return true; 427 return true;
428 } 428 }
429 429
430 bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data,
431 BookmarkModel* model, const BookmarkNode* parent, int idx) {
432 GURL url;
433 string16 title;
434 if (!gtk_dnd_util::ExtractNetscapeURL(selection_data, &url, &title))
435 return false;
436
437 model->AddURL(parent, idx, title, url);
438 return true;
439 }
440
430 } // namespace bookmark_utils 441 } // namespace bookmark_utils
OLDNEW
« app/gtk_dnd_util.cc ('K') | « chrome/browser/gtk/bookmark_utils_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698