| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 context_menu_->Cancel(); | 123 context_menu_->Cancel(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void BookmarkMenuController::NavigateToMenuItem( | 126 void BookmarkMenuController::NavigateToMenuItem( |
| 127 GtkWidget* menu_item, | 127 GtkWidget* menu_item, |
| 128 WindowOpenDisposition disposition) { | 128 WindowOpenDisposition disposition) { |
| 129 const BookmarkNode* node = GetNodeFromMenuItem(menu_item); | 129 const BookmarkNode* node = GetNodeFromMenuItem(menu_item); |
| 130 DCHECK(node); | 130 DCHECK(node); |
| 131 DCHECK(page_navigator_); | 131 DCHECK(page_navigator_); |
| 132 page_navigator_->OpenURL(OpenURLParams( | 132 page_navigator_->OpenURL(OpenURLParams( |
| 133 node->url(), GURL(), disposition, | 133 node->url(), content::Referrer(), disposition, |
| 134 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 134 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, | 137 void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, |
| 138 int start_child_index, | 138 int start_child_index, |
| 139 GtkWidget* menu) { | 139 GtkWidget* menu) { |
| 140 DCHECK(parent->empty() || start_child_index < parent->child_count()); | 140 DCHECK(parent->empty() || start_child_index < parent->child_count()); |
| 141 | 141 |
| 142 signals_.Connect(menu, "button-press-event", | 142 signals_.Connect(menu, "button-press-event", |
| 143 G_CALLBACK(OnMenuButtonPressedOrReleasedThunk), this); | 143 G_CALLBACK(OnMenuButtonPressedOrReleasedThunk), this); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 void BookmarkMenuController::OnMenuItemDragGet( | 360 void BookmarkMenuController::OnMenuItemDragGet( |
| 361 GtkWidget* widget, GdkDragContext* context, | 361 GtkWidget* widget, GdkDragContext* context, |
| 362 GtkSelectionData* selection_data, | 362 GtkSelectionData* selection_data, |
| 363 guint target_type, guint time) { | 363 guint target_type, guint time) { |
| 364 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); | 364 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); |
| 365 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, | 365 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, |
| 366 profile_); | 366 profile_); |
| 367 } | 367 } |
| OLD | NEW |