| 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/browser_toolbar_gtk.h" | 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); | 445 GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); |
| 446 | 446 |
| 447 return button; | 447 return button; |
| 448 } | 448 } |
| 449 | 449 |
| 450 void BrowserToolbarGtk::SetUpDragForHomeButton() { | 450 void BrowserToolbarGtk::SetUpDragForHomeButton() { |
| 451 // TODO(estade): we should use a custom drag-drop handler so that we can | 451 // TODO(estade): we should use a custom drag-drop handler so that we can |
| 452 // prefer URIs over plain text when both are available. | 452 // prefer URIs over plain text when both are available. |
| 453 gtk_drag_dest_set(home_->widget(), GTK_DEST_DEFAULT_ALL, | 453 gtk_drag_dest_set(home_->widget(), GTK_DEST_DEFAULT_ALL, |
| 454 NULL, 0, GDK_ACTION_COPY); | 454 NULL, 0, GDK_ACTION_COPY); |
| 455 GtkDndUtil::SetDestTargetListFromCodeMask(home_->widget(), | 455 static const int targets[] = { GtkDndUtil::TEXT_PLAIN, |
| 456 GtkDndUtil::TEXT_PLAIN | | 456 GtkDndUtil::TEXT_URI_LIST, 0 }; |
| 457 GtkDndUtil::TEXT_URI_LIST); | 457 GtkDndUtil::SetDestTargetList(home_->widget(), targets); |
| 458 | 458 |
| 459 g_signal_connect(home_->widget(), "drag-data-received", | 459 g_signal_connect(home_->widget(), "drag-data-received", |
| 460 G_CALLBACK(OnDragDataReceived), this); | 460 G_CALLBACK(OnDragDataReceived), this); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void BrowserToolbarGtk::ChangeActiveMenu(GtkWidget* active_menu, | 463 void BrowserToolbarGtk::ChangeActiveMenu(GtkWidget* active_menu, |
| 464 guint timestamp) { | 464 guint timestamp) { |
| 465 MenuGtk* old_menu; | 465 MenuGtk* old_menu; |
| 466 MenuGtk* new_menu; | 466 MenuGtk* new_menu; |
| 467 GtkWidget* relevant_button; | 467 GtkWidget* relevant_button; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 g_signal_stop_emission_by_name(menu, "move-current"); | 635 g_signal_stop_emission_by_name(menu, "move-current"); |
| 636 default: | 636 default: |
| 637 break; | 637 break; |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 | 640 |
| 641 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { | 641 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { |
| 642 // If we're a popup window, only show the location bar (omnibox). | 642 // If we're a popup window, only show the location bar (omnibox). |
| 643 return browser_->type() != Browser::TYPE_NORMAL; | 643 return browser_->type() != Browser::TYPE_NORMAL; |
| 644 } | 644 } |
| OLD | NEW |