| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // Don't handle this message; it was a drag. | 285 // Don't handle this message; it was a drag. |
| 286 ignore_button_release_ = false; | 286 ignore_button_release_ = false; |
| 287 return FALSE; | 287 return FALSE; |
| 288 } | 288 } |
| 289 | 289 |
| 290 // Releasing either button 1 or 2 should trigger the bookmark. | 290 // Releasing either button 1 or 2 should trigger the bookmark. |
| 291 if (!gtk_menu_item_get_submenu(GTK_MENU_ITEM(sender))) { | 291 if (!gtk_menu_item_get_submenu(GTK_MENU_ITEM(sender))) { |
| 292 // The menu item is a link node. | 292 // The menu item is a link node. |
| 293 if (event->button == 1 || event->button == 2) { | 293 if (event->button == 1 || event->button == 2) { |
| 294 WindowOpenDisposition disposition = | 294 WindowOpenDisposition disposition = |
| 295 event_utils::DispositionFromEventFlags(event->state); | 295 event_utils::DispositionFromGdkState(event->state); |
| 296 |
| 296 NavigateToMenuItem(sender, disposition); | 297 NavigateToMenuItem(sender, disposition); |
| 297 | 298 |
| 298 // We need to manually dismiss the popup menu because we're overriding | 299 // We need to manually dismiss the popup menu because we're overriding |
| 299 // button-release-event. | 300 // button-release-event. |
| 300 gtk_menu_popdown(GTK_MENU(menu_)); | 301 gtk_menu_popdown(GTK_MENU(menu_)); |
| 301 return TRUE; | 302 return TRUE; |
| 302 } | 303 } |
| 303 } else { | 304 } else { |
| 304 // The menu item is a folder node. | 305 // The menu item is a folder node. |
| 305 if (event->button == 1) { | 306 if (event->button == 1) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 363 } |
| 363 | 364 |
| 364 void BookmarkMenuController::OnMenuItemDragGet( | 365 void BookmarkMenuController::OnMenuItemDragGet( |
| 365 GtkWidget* widget, GdkDragContext* context, | 366 GtkWidget* widget, GdkDragContext* context, |
| 366 GtkSelectionData* selection_data, | 367 GtkSelectionData* selection_data, |
| 367 guint target_type, guint time) { | 368 guint target_type, guint time) { |
| 368 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); | 369 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); |
| 369 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, | 370 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, |
| 370 profile_); | 371 profile_); |
| 371 } | 372 } |
| OLD | NEW |