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

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

Issue 149301: Gtk: URI list dragging for bookmarks (source side only)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: undo accidental change Created 11 years, 5 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/gtk/bookmark_utils_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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk_dnd_util.h" 5 #include "chrome/browser/gtk/gtk_dnd_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 // static 9 // static
10 GdkAtom GtkDndUtil::GetAtomForTarget(int target) { 10 GdkAtom GtkDndUtil::GetAtomForTarget(int target) {
11 switch (target) { 11 switch (target) {
12 case X_CHROME_TAB: 12 case X_CHROME_TAB:
13 static GdkAtom tab_atom = gdk_atom_intern( 13 static GdkAtom tab_atom = gdk_atom_intern(
14 const_cast<char*>("application/x-chrome-tab"), false); 14 const_cast<char*>("application/x-chrome-tab"), false);
15 return tab_atom; 15 return tab_atom;
16 16
17 case X_CHROME_TEXT_HTML: 17 case X_CHROME_TEXT_HTML:
18 static GdkAtom html_atom = gdk_atom_intern( 18 static GdkAtom html_atom = gdk_atom_intern(
19 const_cast<char*>("text/html"), false); 19 const_cast<char*>("text/html"), false);
20 return html_atom; 20 return html_atom;
21 21
22 case X_CHROME_BOOKMARK_ITEM: 22 case X_CHROME_BOOKMARK_ITEM:
23 static GdkAtom bookmark_atom = gdk_atom_intern( 23 static GdkAtom bookmark_atom = gdk_atom_intern(
24 const_cast<char*>("application/x-chrome-bookmark-item"), false); 24 const_cast<char*>("application/x-chrome-bookmark-item"), false);
25 return bookmark_atom; 25 return bookmark_atom;
26 26
27 case X_CHROME_TEXT_PLAIN: 27 case X_CHROME_TEXT_PLAIN:
28 static GdkAtom text_atom = gdk_atom_intern(
29 const_cast<char*>("text/plain"), false);
30 return text_atom;
31
28 case X_CHROME_TEXT_URI_LIST: 32 case X_CHROME_TEXT_URI_LIST:
29 return NULL; 33 static GdkAtom uris_atom = gdk_atom_intern(
34 const_cast<char*>("text/uri-list"), false);
35 return uris_atom;
30 36
31 default: 37 default:
32 NOTREACHED(); 38 NOTREACHED();
33 } 39 }
34 40
35 return NULL; 41 return NULL;
36 } 42 }
37 43
38 // static 44 // static
39 GtkTargetList* GtkDndUtil::GetTargetListFromCodeMask(int code_mask) { 45 GtkTargetList* GtkDndUtil::GetTargetListFromCodeMask(int code_mask) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 gtk_target_list_unref(targets); 77 gtk_target_list_unref(targets);
72 } 78 }
73 79
74 // static 80 // static
75 void GtkDndUtil::SetSourceTargetListFromCodeMask(GtkWidget* source, 81 void GtkDndUtil::SetSourceTargetListFromCodeMask(GtkWidget* source,
76 int code_mask) { 82 int code_mask) {
77 GtkTargetList* targets = GetTargetListFromCodeMask(code_mask); 83 GtkTargetList* targets = GetTargetListFromCodeMask(code_mask);
78 gtk_drag_source_set_target_list(source, targets); 84 gtk_drag_source_set_target_list(source, targets);
79 gtk_target_list_unref(targets); 85 gtk_target_list_unref(targets);
80 } 86 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_utils_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698