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" | |
10 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/browser/bookmarks/bookmark_utils.h" | 12 #include "chrome/browser/bookmarks/bookmark_utils.h" |
14 #include "chrome/browser/browser_shutdown.h" | 13 #include "chrome/browser/browser_shutdown.h" |
15 #include "chrome/browser/importer/importer_data_types.h" | 14 #include "chrome/browser/importer/importer_data_types.h" |
16 #include "chrome/browser/metrics/user_metrics.h" | 15 #include "chrome/browser/metrics/user_metrics.h" |
17 #include "chrome/browser/ntp_background_util.h" | 16 #include "chrome/browser/ntp_background_util.h" |
18 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
19 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
(...skipping 19 matching lines...) Expand all Loading... |
39 #include "chrome/browser/ui/gtk/view_id_util.h" | 38 #include "chrome/browser/ui/gtk/view_id_util.h" |
40 #include "chrome/common/notification_service.h" | 39 #include "chrome/common/notification_service.h" |
41 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
42 #include "gfx/canvas_skia_paint.h" | 41 #include "gfx/canvas_skia_paint.h" |
43 #include "gfx/gtk_util.h" | 42 #include "gfx/gtk_util.h" |
44 #include "grit/app_resources.h" | 43 #include "grit/app_resources.h" |
45 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
46 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
47 #include "ui/base/animation/slide_animation.h" | 46 #include "ui/base/animation/slide_animation.h" |
48 #include "ui/base/dragdrop/gtk_dnd_util.h" | 47 #include "ui/base/dragdrop/gtk_dnd_util.h" |
| 48 #include "ui/base/resource/resource_bundle.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 |
55 // Padding for when the bookmark bar is floating. | 55 // Padding for when the bookmark bar is floating. |
56 const int kTopBottomNTPPadding = 12; | 56 const int kTopBottomNTPPadding = 12; |
57 const int kLeftRightNTPPadding = 8; | 57 const int kLeftRightNTPPadding = 8; |
58 | 58 |
(...skipping 1348 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 |