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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 void BookmarkMenuController::NavigateToMenuItem( | 132 void BookmarkMenuController::NavigateToMenuItem( |
133 GtkWidget* menu_item, | 133 GtkWidget* menu_item, |
134 WindowOpenDisposition disposition) { | 134 WindowOpenDisposition disposition) { |
135 const BookmarkNode* node = GetNodeFromMenuItem(menu_item); | 135 const BookmarkNode* node = GetNodeFromMenuItem(menu_item); |
136 DCHECK(node); | 136 DCHECK(node); |
137 DCHECK(page_navigator_); | 137 DCHECK(page_navigator_); |
138 page_navigator_->OpenURL(OpenURLParams( | 138 page_navigator_->OpenURL(OpenURLParams( |
139 node->url(), GURL(), disposition, | 139 node->url(), GURL(), disposition, |
140 content::PAGE_TRANSITION_AUTO_BOOKMARK)); | 140 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
141 } | 141 } |
142 | 142 |
143 void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, | 143 void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, |
144 int start_child_index, | 144 int start_child_index, |
145 GtkWidget* menu) { | 145 GtkWidget* menu) { |
146 DCHECK(parent->empty() || start_child_index < parent->child_count()); | 146 DCHECK(parent->empty() || start_child_index < parent->child_count()); |
147 | 147 |
148 signals_.Connect(menu, "button-press-event", | 148 signals_.Connect(menu, "button-press-event", |
149 G_CALLBACK(OnMenuButtonPressedOrReleasedThunk), this); | 149 G_CALLBACK(OnMenuButtonPressedOrReleasedThunk), this); |
150 signals_.Connect(menu, "button-release-event", | 150 signals_.Connect(menu, "button-release-event", |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 364 } |
365 | 365 |
366 void BookmarkMenuController::OnMenuItemDragGet( | 366 void BookmarkMenuController::OnMenuItemDragGet( |
367 GtkWidget* widget, GdkDragContext* context, | 367 GtkWidget* widget, GdkDragContext* context, |
368 GtkSelectionData* selection_data, | 368 GtkSelectionData* selection_data, |
369 guint target_type, guint time) { | 369 guint target_type, guint time) { |
370 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); | 370 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); |
371 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, | 371 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, |
372 profile_); | 372 profile_); |
373 } | 373 } |
OLD | NEW |