OLD | NEW |
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/bookmark_bar_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/gfx/text_elider.h" | 9 #include "app/gfx/text_elider.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 392 |
393 GtkWidget* BookmarkBarGtk::CreateBookmarkButton(const BookmarkNode* node) { | 393 GtkWidget* BookmarkBarGtk::CreateBookmarkButton(const BookmarkNode* node) { |
394 GtkWidget* button = gtk_chrome_button_new(); | 394 GtkWidget* button = gtk_chrome_button_new(); |
395 GtkThemeProperties properties(profile_); | 395 GtkThemeProperties properties(profile_); |
396 bookmark_utils::ConfigureButtonForNode(node, model_, button, &properties); | 396 bookmark_utils::ConfigureButtonForNode(node, model_, button, &properties); |
397 | 397 |
398 // The tool item is also a source for dragging | 398 // The tool item is also a source for dragging |
399 gtk_drag_source_set(button, GDK_BUTTON1_MASK, | 399 gtk_drag_source_set(button, GDK_BUTTON1_MASK, |
400 NULL, 0, GDK_ACTION_MOVE); | 400 NULL, 0, GDK_ACTION_MOVE); |
401 GtkDndUtil::SetSourceTargetListFromCodeMask( | 401 GtkDndUtil::SetSourceTargetListFromCodeMask( |
402 button, GtkDndUtil::X_CHROME_BOOKMARK_ITEM); | 402 button, GtkDndUtil::X_CHROME_BOOKMARK_ITEM | |
| 403 GtkDndUtil::X_CHROME_TEXT_URI_LIST); |
403 g_signal_connect(G_OBJECT(button), "drag-begin", | 404 g_signal_connect(G_OBJECT(button), "drag-begin", |
404 G_CALLBACK(&OnButtonDragBegin), this); | 405 G_CALLBACK(&OnButtonDragBegin), this); |
405 g_signal_connect(G_OBJECT(button), "drag-end", | 406 g_signal_connect(G_OBJECT(button), "drag-end", |
406 G_CALLBACK(&OnButtonDragEnd), this); | 407 G_CALLBACK(&OnButtonDragEnd), this); |
407 g_signal_connect(G_OBJECT(button), "drag-data-get", | 408 g_signal_connect(G_OBJECT(button), "drag-data-get", |
408 G_CALLBACK(&OnButtonDragGet), this); | 409 G_CALLBACK(&OnButtonDragGet), this); |
409 // We deliberately don't connect to "drag-data-delete" because the action of | 410 // We deliberately don't connect to "drag-data-delete" because the action of |
410 // moving a button will regenerate all the contents of the bookmarks bar | 411 // moving a button will regenerate all the contents of the bookmarks bar |
411 // anyway. | 412 // anyway. |
412 | 413 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 bar->InitBackground(); | 775 bar->InitBackground(); |
775 gfx::Point tabstrip_origin = | 776 gfx::Point tabstrip_origin = |
776 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget); | 777 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget); |
777 bar->background_ninebox_->RenderTopCenterStrip( | 778 bar->background_ninebox_->RenderTopCenterStrip( |
778 cr, tabstrip_origin.x(), tabstrip_origin.y(), | 779 cr, tabstrip_origin.x(), tabstrip_origin.y(), |
779 event->area.x + event->area.width - tabstrip_origin.x()); | 780 event->area.x + event->area.width - tabstrip_origin.x()); |
780 cairo_destroy(cr); | 781 cairo_destroy(cr); |
781 | 782 |
782 return FALSE; // Propagate expose to children. | 783 return FALSE; // Propagate expose to children. |
783 } | 784 } |
OLD | NEW |