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_manager_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_manager_gtk.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 G_CALLBACK(OnRightTreeViewMotion), this); | 500 G_CALLBACK(OnRightTreeViewMotion), this); |
501 g_signal_connect(right_tree_view_, "button-release-event", | 501 g_signal_connect(right_tree_view_, "button-release-event", |
502 G_CALLBACK(OnTreeViewButtonRelease), this); | 502 G_CALLBACK(OnTreeViewButtonRelease), this); |
503 | 503 |
504 // We don't advertise GDK_ACTION_COPY, but since we don't explicitly do | 504 // We don't advertise GDK_ACTION_COPY, but since we don't explicitly do |
505 // any deleting following a succesful move, this should work. | 505 // any deleting following a succesful move, this should work. |
506 gtk_drag_source_set(right_tree_view_, | 506 gtk_drag_source_set(right_tree_view_, |
507 GDK_BUTTON1_MASK, | 507 GDK_BUTTON1_MASK, |
508 NULL, 0, GDK_ACTION_MOVE); | 508 NULL, 0, GDK_ACTION_MOVE); |
509 GtkDndUtil::SetSourceTargetListFromCodeMask( | 509 GtkDndUtil::SetSourceTargetListFromCodeMask( |
510 right_tree_view_, GtkDndUtil::X_CHROME_BOOKMARK_ITEM); | 510 right_tree_view_, GtkDndUtil::X_CHROME_BOOKMARK_ITEM | |
| 511 GtkDndUtil::X_CHROME_TEXT_URI_LIST); |
511 | 512 |
512 // We connect to drag dest signals, but we don't actually enable the widget | 513 // We connect to drag dest signals, but we don't actually enable the widget |
513 // as a drag destination unless it corresponds to the contents of a folder. | 514 // as a drag destination unless it corresponds to the contents of a folder. |
514 // See BuildRightStore(). | 515 // See BuildRightStore(). |
515 g_signal_connect(right_tree_view_, "drag-data-get", | 516 g_signal_connect(right_tree_view_, "drag-data-get", |
516 G_CALLBACK(&OnRightTreeViewDragGet), this); | 517 G_CALLBACK(&OnRightTreeViewDragGet), this); |
517 g_signal_connect(right_tree_view_, "drag-data-received", | 518 g_signal_connect(right_tree_view_, "drag-data-received", |
518 G_CALLBACK(&OnRightTreeViewDragReceived), this); | 519 G_CALLBACK(&OnRightTreeViewDragReceived), this); |
519 g_signal_connect(right_tree_view_, "drag-motion", | 520 g_signal_connect(right_tree_view_, "drag-motion", |
520 G_CALLBACK(&OnRightTreeViewDragMotion), this); | 521 G_CALLBACK(&OnRightTreeViewDragMotion), this); |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 gboolean BookmarkManagerGtk::OnRightTreeViewMotion(GtkWidget* tree_view, | 1128 gboolean BookmarkManagerGtk::OnRightTreeViewMotion(GtkWidget* tree_view, |
1128 GdkEventMotion* event, BookmarkManagerGtk* bm) { | 1129 GdkEventMotion* event, BookmarkManagerGtk* bm) { |
1129 // This handler is only used for the multi-drag workaround. | 1130 // This handler is only used for the multi-drag workaround. |
1130 if (!bm->delaying_mousedown_) | 1131 if (!bm->delaying_mousedown_) |
1131 return FALSE; | 1132 return FALSE; |
1132 | 1133 |
1133 if (gtk_drag_check_threshold(tree_view, | 1134 if (gtk_drag_check_threshold(tree_view, |
1134 bm->mousedown_event_.x, bm->mousedown_event_.y, event->x, event->y)) { | 1135 bm->mousedown_event_.x, bm->mousedown_event_.y, event->x, event->y)) { |
1135 bm->delaying_mousedown_ = false; | 1136 bm->delaying_mousedown_ = false; |
1136 GtkTargetList* targets = GtkDndUtil::GetTargetListFromCodeMask( | 1137 GtkTargetList* targets = GtkDndUtil::GetTargetListFromCodeMask( |
1137 GtkDndUtil::X_CHROME_BOOKMARK_ITEM); | 1138 GtkDndUtil::X_CHROME_BOOKMARK_ITEM | |
| 1139 GtkDndUtil::X_CHROME_TEXT_URI_LIST); |
1138 gtk_drag_begin(tree_view, targets, GDK_ACTION_MOVE, | 1140 gtk_drag_begin(tree_view, targets, GDK_ACTION_MOVE, |
1139 1, reinterpret_cast<GdkEvent*>(event)); | 1141 1, reinterpret_cast<GdkEvent*>(event)); |
1140 // The drag adds a ref; let it own the list. | 1142 // The drag adds a ref; let it own the list. |
1141 gtk_target_list_unref(targets); | 1143 gtk_target_list_unref(targets); |
1142 } | 1144 } |
1143 | 1145 |
1144 return FALSE; | 1146 return FALSE; |
1145 } | 1147 } |
1146 | 1148 |
1147 // static | 1149 // static |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { | 1216 } else if (id == IDS_BOOKMARK_MANAGER_EXPORT_MENU) { |
1215 if (g_browser_process->io_thread()) { | 1217 if (g_browser_process->io_thread()) { |
1216 bookmark_html_writer::WriteBookmarks( | 1218 bookmark_html_writer::WriteBookmarks( |
1217 g_browser_process->io_thread()->message_loop(), model_, | 1219 g_browser_process->io_thread()->message_loop(), model_, |
1218 path.ToWStringHack()); | 1220 path.ToWStringHack()); |
1219 } | 1221 } |
1220 } else { | 1222 } else { |
1221 NOTREACHED(); | 1223 NOTREACHED(); |
1222 } | 1224 } |
1223 } | 1225 } |
OLD | NEW |