| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_actions_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // The width of the browser action buttons. | 57 // The width of the browser action buttons. |
| 58 const int kButtonWidth = 27; | 58 const int kButtonWidth = 27; |
| 59 | 59 |
| 60 // The padding between browser action buttons. | 60 // The padding between browser action buttons. |
| 61 const int kButtonPadding = 4; | 61 const int kButtonPadding = 4; |
| 62 | 62 |
| 63 // The padding to the right of the browser action buttons (between the buttons | 63 // The padding to the right of the browser action buttons (between the buttons |
| 64 // and chevron if they are both showing). | 64 // and chevron if they are both showing). |
| 65 const int kButtonChevronPadding = 2; | 65 const int kButtonChevronPadding = 2; |
| 66 | 66 |
| 67 // The padding to the left, top and bottom of the browser actions toolbar | |
| 68 // separator. | |
| 69 const int kSeparatorPadding = 2; | |
| 70 | |
| 71 // Width of the invisible gripper for resizing the toolbar. | 67 // Width of the invisible gripper for resizing the toolbar. |
| 72 const int kResizeGripperWidth = 4; | 68 const int kResizeGripperWidth = 4; |
| 73 | 69 |
| 74 const char kDragTarget[] = "application/x-chrome-browseraction"; | 70 const char kDragTarget[] = "application/x-chrome-browseraction"; |
| 75 | 71 |
| 76 GtkTargetEntry GetDragTargetEntry() { | 72 GtkTargetEntry GetDragTargetEntry() { |
| 77 GtkTargetEntry drag_target; | 73 GtkTargetEntry drag_target; |
| 78 drag_target.target = const_cast<char*>(kDragTarget); | 74 drag_target.target = const_cast<char*>(kDragTarget); |
| 79 drag_target.flags = GTK_TARGET_SAME_APP; | 75 drag_target.flags = GTK_TARGET_SAME_APP; |
| 80 drag_target.info = 0; | 76 drag_target.info = 0; |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 | 1089 |
| 1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1090 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
| 1095 event->time); | 1091 event->time); |
| 1096 return TRUE; | 1092 return TRUE; |
| 1097 } | 1093 } |
| 1098 | 1094 |
| 1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1095 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
| 1100 if (!resize_animation_.is_animating()) | 1096 if (!resize_animation_.is_animating()) |
| 1101 UpdateChevronVisibility(); | 1097 UpdateChevronVisibility(); |
| 1102 } | 1098 } |
| OLD | NEW |