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

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

Issue 548067: Allow link drags from the star, bookmarks bar, and bookmark bar menus (Closed)
Patch Set: Created 10 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
« no previous file with comments | « chrome/browser/gtk/tab_contents_drag_source.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/toolbar_star_toggle_gtk.h" 5 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h"
6 6
7 #include "app/gtk_dnd_util.h" 7 #include "app/gtk_dnd_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 20 matching lines...) Expand all
31 unstarred_.Height()); 31 unstarred_.Height());
32 32
33 gtk_widget_set_app_paintable(widget_.get(), TRUE); 33 gtk_widget_set_app_paintable(widget_.get(), TRUE);
34 // We effectively double-buffer by virtue of having only one image... 34 // We effectively double-buffer by virtue of having only one image...
35 gtk_widget_set_double_buffered(widget_.get(), FALSE); 35 gtk_widget_set_double_buffered(widget_.get(), FALSE);
36 36
37 g_signal_connect(widget(), "expose-event", 37 g_signal_connect(widget(), "expose-event",
38 G_CALLBACK(OnExpose), this); 38 G_CALLBACK(OnExpose), this);
39 GTK_WIDGET_UNSET_FLAGS(widget_.get(), GTK_CAN_FOCUS); 39 GTK_WIDGET_UNSET_FLAGS(widget_.get(), GTK_CAN_FOCUS);
40 40
41 gtk_drag_source_set(widget(), GDK_BUTTON1_MASK, 41 gtk_drag_source_set(widget(), GDK_BUTTON1_MASK, NULL, 0,
42 NULL, 0, GDK_ACTION_COPY); 42 static_cast<GdkDragAction>(GDK_ACTION_COPY | GDK_ACTION_LINK));
43 GtkDndUtil::SetSourceTargetListFromCodeMask(widget(), 43 GtkDndUtil::SetSourceTargetListFromCodeMask(widget(),
44 GtkDndUtil::TEXT_PLAIN | 44 GtkDndUtil::TEXT_PLAIN |
45 GtkDndUtil::TEXT_URI_LIST | 45 GtkDndUtil::TEXT_URI_LIST |
46 GtkDndUtil::CHROME_NAMED_URL); 46 GtkDndUtil::CHROME_NAMED_URL |
47 GtkDndUtil::NETSCAPE_URL);
47 g_signal_connect(widget(), "drag-data-get", G_CALLBACK(OnDragDataGet), this); 48 g_signal_connect(widget(), "drag-data-get", G_CALLBACK(OnDragDataGet), this);
48 49
49 theme_provider_->InitThemesFor(this); 50 theme_provider_->InitThemesFor(this);
50 registrar_.Add(this, 51 registrar_.Add(this,
51 NotificationType::BROWSER_THEME_CHANGED, 52 NotificationType::BROWSER_THEME_CHANGED,
52 NotificationService::AllSources()); 53 NotificationService::AllSources());
53 } 54 }
54 55
55 ToolbarStarToggleGtk::~ToolbarStarToggleGtk() { 56 ToolbarStarToggleGtk::~ToolbarStarToggleGtk() {
56 widget_.Destroy(); 57 widget_.Destroy();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 unstarred_.Height()); 131 unstarred_.Height());
131 132
132 gtk_widget_set_app_paintable(widget_.get(), TRUE); 133 gtk_widget_set_app_paintable(widget_.get(), TRUE);
133 // We effectively double-buffer by virtue of having only one image... 134 // We effectively double-buffer by virtue of having only one image...
134 gtk_widget_set_double_buffered(widget_.get(), FALSE); 135 gtk_widget_set_double_buffered(widget_.get(), FALSE);
135 } 136 }
136 137
137 gtk_chrome_button_set_use_gtk_rendering( 138 gtk_chrome_button_set_use_gtk_rendering(
138 GTK_CHROME_BUTTON(widget_.get()), use_gtk); 139 GTK_CHROME_BUTTON(widget_.get()), use_gtk);
139 } 140 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/tab_contents_drag_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698