| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_bar_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 12 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_model.h" | 13 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_utils.h" | 14 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 15 #include "chrome/browser/browser_shutdown.h" | 15 #include "chrome/browser/browser_shutdown.h" |
| 16 #include "chrome/browser/browser.h" | |
| 17 #include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" | 16 #include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" |
| 18 #include "chrome/browser/gtk/bookmark_tree_model.h" | 17 #include "chrome/browser/gtk/bookmark_tree_model.h" |
| 19 #include "chrome/browser/gtk/bookmark_utils_gtk.h" | 18 #include "chrome/browser/gtk/bookmark_utils_gtk.h" |
| 20 #include "chrome/browser/gtk/browser_window_gtk.h" | 19 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 21 #include "chrome/browser/gtk/cairo_cached_surface.h" | 20 #include "chrome/browser/gtk/cairo_cached_surface.h" |
| 22 #include "chrome/browser/gtk/custom_button.h" | 21 #include "chrome/browser/gtk/custom_button.h" |
| 23 #include "chrome/browser/gtk/gtk_chrome_button.h" | 22 #include "chrome/browser/gtk/gtk_chrome_button.h" |
| 24 #include "chrome/browser/gtk/gtk_theme_provider.h" | 23 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 25 #include "chrome/browser/gtk/gtk_util.h" | 24 #include "chrome/browser/gtk/gtk_util.h" |
| 26 #include "chrome/browser/gtk/hover_controller_gtk.h" | 25 #include "chrome/browser/gtk/hover_controller_gtk.h" |
| 27 #include "chrome/browser/gtk/import_dialog_gtk.h" | 26 #include "chrome/browser/gtk/import_dialog_gtk.h" |
| 28 #include "chrome/browser/gtk/menu_gtk.h" | 27 #include "chrome/browser/gtk/menu_gtk.h" |
| 29 #include "chrome/browser/gtk/rounded_window.h" | 28 #include "chrome/browser/gtk/rounded_window.h" |
| 30 #include "chrome/browser/gtk/tabstrip_origin_provider.h" | 29 #include "chrome/browser/gtk/tabstrip_origin_provider.h" |
| 31 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" | 30 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 32 #include "chrome/browser/gtk/view_id_util.h" | 31 #include "chrome/browser/gtk/view_id_util.h" |
| 33 #include "chrome/browser/importer/importer_data_types.h" | 32 #include "chrome/browser/importer/importer_data_types.h" |
| 34 #include "chrome/browser/metrics/user_metrics.h" | 33 #include "chrome/browser/metrics/user_metrics.h" |
| 35 #include "chrome/browser/ntp_background_util.h" | 34 #include "chrome/browser/ntp_background_util.h" |
| 36 #include "chrome/browser/prefs/pref_service.h" | 35 #include "chrome/browser/prefs/pref_service.h" |
| 37 #include "chrome/browser/profile.h" | 36 #include "chrome/browser/profile.h" |
| 38 #include "chrome/browser/sync/sync_ui_util.h" | 37 #include "chrome/browser/sync/sync_ui_util.h" |
| 39 #include "chrome/browser/tab_contents/tab_contents.h" | 38 #include "chrome/browser/tab_contents/tab_contents.h" |
| 40 #include "chrome/browser/tab_contents/tab_contents_view.h" | 39 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 40 #include "chrome/browser/ui/browser.h" |
| 41 #include "chrome/common/notification_service.h" | 41 #include "chrome/common/notification_service.h" |
| 42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| 43 #include "gfx/canvas_skia_paint.h" | 43 #include "gfx/canvas_skia_paint.h" |
| 44 #include "gfx/gtk_util.h" | 44 #include "gfx/gtk_util.h" |
| 45 #include "grit/app_resources.h" | 45 #include "grit/app_resources.h" |
| 46 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
| 47 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| (...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 | 1408 |
| 1409 // Find the GtkWidget* for the actual target button. | 1409 // Find the GtkWidget* for the actual target button. |
| 1410 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1410 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
| 1411 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1411 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
| 1412 PopupForButton(folder_list[button_idx]); | 1412 PopupForButton(folder_list[button_idx]); |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 void BookmarkBarGtk::CloseMenu() { | 1415 void BookmarkBarGtk::CloseMenu() { |
| 1416 current_context_menu_->Cancel(); | 1416 current_context_menu_->Cancel(); |
| 1417 } | 1417 } |
| OLD | NEW |