| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/toolbar/extension_toolbar_menu_view.h" | 5 #include "chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/frame/browser_view.h" | 7 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 8 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 8 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 9 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 9 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 10 #include "ui/views/controls/menu/menu_item_view.h" | 10 #include "ui/views/controls/menu/menu_item_view.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 if (sz.height() == 0) | 37 if (sz.height() == 0) |
| 38 return sz; | 38 return sz; |
| 39 | 39 |
| 40 sz.Enlarge(0, kVerticalPadding); | 40 sz.Enlarge(0, kVerticalPadding); |
| 41 return sz; | 41 return sz; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void ExtensionToolbarMenuView::Layout() { | 44 void ExtensionToolbarMenuView::Layout() { |
| 45 // All buttons are given the same width. | 45 // All buttons are given the same width. |
| 46 gfx::Size sz = container_->GetPreferredSize(); | 46 gfx::Size sz = container_->GetPreferredSize(); |
| 47 container_->SetBounds(views::MenuItemView::label_start(), | 47 int height = sz.height() + kVerticalPadding / 2; |
| 48 0, | 48 SetBounds(views::MenuItemView::label_start(), 0, sz.width(), height); |
| 49 sz.width(), | 49 container_->SetBounds(0, 0, sz.width(), height); |
| 50 sz.height() + (kVerticalPadding / 2)); | |
| 51 } | 50 } |
| OLD | NEW |