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/gfx/canvas_paint.h" | |
10 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
11 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
13 #include "app/text_elider.h" | 12 #include "app/text_elider.h" |
14 #include "base/pickle.h" | 13 #include "base/pickle.h" |
15 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 14 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
16 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
17 #include "chrome/browser/bookmarks/bookmark_utils.h" | 16 #include "chrome/browser/bookmarks/bookmark_utils.h" |
18 #include "chrome/browser/browser.h" | 17 #include "chrome/browser/browser.h" |
19 #include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" | 18 #include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" |
(...skipping 15 matching lines...) Expand all Loading... |
35 #include "chrome/browser/importer/importer_data_types.h" | 34 #include "chrome/browser/importer/importer_data_types.h" |
36 #include "chrome/browser/metrics/user_metrics.h" | 35 #include "chrome/browser/metrics/user_metrics.h" |
37 #include "chrome/browser/ntp_background_util.h" | 36 #include "chrome/browser/ntp_background_util.h" |
38 #include "chrome/browser/pref_service.h" | 37 #include "chrome/browser/pref_service.h" |
39 #include "chrome/browser/profile.h" | 38 #include "chrome/browser/profile.h" |
40 #include "chrome/browser/sync/sync_ui_util.h" | 39 #include "chrome/browser/sync/sync_ui_util.h" |
41 #include "chrome/browser/tab_contents/tab_contents.h" | 40 #include "chrome/browser/tab_contents/tab_contents.h" |
42 #include "chrome/browser/tab_contents/tab_contents_view.h" | 41 #include "chrome/browser/tab_contents/tab_contents_view.h" |
43 #include "chrome/common/notification_service.h" | 42 #include "chrome/common/notification_service.h" |
44 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "gfx/canvas_paint.h" |
45 #include "gfx/gtk_util.h" | 45 #include "gfx/gtk_util.h" |
46 #include "grit/app_resources.h" | 46 #include "grit/app_resources.h" |
47 #include "grit/generated_resources.h" | 47 #include "grit/generated_resources.h" |
48 #include "grit/theme_resources.h" | 48 #include "grit/theme_resources.h" |
49 | 49 |
50 namespace { | 50 namespace { |
51 | 51 |
52 // The showing height of the bar. | 52 // The showing height of the bar. |
53 const int kBookmarkBarHeight = 29; | 53 const int kBookmarkBarHeight = 29; |
54 | 54 |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 | 1376 |
1377 // Find the GtkWidget* for the actual target button. | 1377 // Find the GtkWidget* for the actual target button. |
1378 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1378 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
1379 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1379 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
1380 PopupForButton(folder_list[button_idx]); | 1380 PopupForButton(folder_list[button_idx]); |
1381 } | 1381 } |
1382 | 1382 |
1383 void BookmarkBarGtk::CloseMenu() { | 1383 void BookmarkBarGtk::CloseMenu() { |
1384 current_context_menu_->Cancel(); | 1384 current_context_menu_->Cancel(); |
1385 } | 1385 } |
OLD | NEW |