| 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/bookmark_bar_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 case ui::TEXT_PLAIN: { | 1272 case ui::TEXT_PLAIN: { |
| 1273 guchar* text = gtk_selection_data_get_text(selection_data); | 1273 guchar* text = gtk_selection_data_get_text(selection_data); |
| 1274 if (!text) | 1274 if (!text) |
| 1275 break; | 1275 break; |
| 1276 GURL url(reinterpret_cast<char*>(text)); | 1276 GURL url(reinterpret_cast<char*>(text)); |
| 1277 g_free(text); | 1277 g_free(text); |
| 1278 // TODO(estade): It would be nice to head this case off at drag motion, | 1278 // TODO(estade): It would be nice to head this case off at drag motion, |
| 1279 // so that it doesn't look like we can drag onto the bookmark bar. | 1279 // so that it doesn't look like we can drag onto the bookmark bar. |
| 1280 if (!url.is_valid()) | 1280 if (!url.is_valid()) |
| 1281 break; | 1281 break; |
| 1282 std::string title = bookmark_utils::GetNameForURL(url); | 1282 string16 title = bookmark_utils::GetNameForURL(url); |
| 1283 model_->AddURL(dest_node, index, UTF8ToUTF16(title), url); | 1283 model_->AddURL(dest_node, index, title, url); |
| 1284 dnd_success = TRUE; | 1284 dnd_success = TRUE; |
| 1285 break; | 1285 break; |
| 1286 } | 1286 } |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 gtk_drag_finish(context, dnd_success, delete_selection_data, time); | 1289 gtk_drag_finish(context, dnd_success, delete_selection_data, time); |
| 1290 } | 1290 } |
| 1291 | 1291 |
| 1292 gboolean BookmarkBarGtk::OnEventBoxExpose(GtkWidget* widget, | 1292 gboolean BookmarkBarGtk::OnEventBoxExpose(GtkWidget* widget, |
| 1293 GdkEventExpose* event) { | 1293 GdkEventExpose* event) { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 | 1407 |
| 1408 // Find the GtkWidget* for the actual target button. | 1408 // Find the GtkWidget* for the actual target button. |
| 1409 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1409 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1410 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1410 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1411 PopupForButton(folder_list[button_idx]); | 1411 PopupForButton(folder_list[button_idx]); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 void BookmarkBarGtk::CloseMenu() { | 1414 void BookmarkBarGtk::CloseMenu() { |
| 1415 current_context_menu_->Cancel(); | 1415 current_context_menu_->Cancel(); |
| 1416 } | 1416 } |
| OLD | NEW |