OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/views/action_box_menu_item_view.h" | |
6 | |
7 // ActionBoxMenuItemView ------------------------------------------------------- | |
8 | |
9 ActionBoxMenuItemView::ActionBoxMenuItemView(views::MenuDelegate* delegate) | |
10 : views::MenuItemView(delegate) { | |
11 } | |
12 | |
13 void ActionBoxMenuItemView::Layout() { | |
14 MenuItemView::Layout(); | |
Aaron Boodman
2012/06/12 05:53:44
I think the child layout is unnecessary since we'r
yefimt
2012/06/13 01:24:21
Not sure it is true, we layout only icon view, and
| |
15 if (!has_children()) | |
16 return; | |
17 | |
18 View* child = child_at(0); | |
19 gfx::Size size = child->GetPreferredSize(); | |
Aaron Boodman
2012/06/12 05:53:44
child->SetPosition(Position(0, 0));
child->SizeToP
yefimt
2012/06/13 01:24:21
Done.
| |
20 child->SetBounds(0, 0, size.width(), size.height()); | |
21 } | |
22 | |
23 ActionBoxMenuItemView::ActionBoxMenuItemView(MenuItemView* parent, | |
24 int command, | |
25 MenuItemView::Type type) | |
26 : MenuItemView(parent, command, type) { | |
27 } | |
28 | |
29 ActionBoxMenuItemView::~ActionBoxMenuItemView() { | |
30 } | |
31 | |
32 void ActionBoxMenuItemView::OnPaint(gfx::Canvas* canvas) { | |
33 MenuItemView::OnPaint(canvas); | |
Aaron Boodman
2012/06/12 05:53:44
No need to override?
yefimt
2012/06/13 01:24:21
Yes, removed it after it was uploaded
On 2012/06/1
| |
34 } | |
35 | |
36 views::MenuItemView* ActionBoxMenuItemView::AllocateMenuItemView( | |
37 views::MenuItemView* parent, int item_id, Type type) { | |
38 return new ActionBoxMenuItemView(parent, item_id, type); | |
39 } | |
OLD | NEW |