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/apps/app_info_dialog/app_info_panel.h" | 5 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" |
6 | 6 |
7 #include "ui/base/resource/resource_bundle.h" | 7 #include "ui/base/resource/resource_bundle.h" |
8 #include "ui/views/controls/label.h" | 8 #include "ui/views/controls/label.h" |
9 #include "ui/views/layout/box_layout.h" | 9 #include "ui/views/layout/box_layout.h" |
10 #include "ui/views/layout/layout_constants.h" | 10 #include "ui/views/layout/layout_constants.h" |
11 | 11 |
12 AppInfoPanel::AppInfoPanel(Profile* profile, const extensions::Extension* app) | 12 AppInfoPanel::AppInfoPanel(Profile* profile, const extensions::Extension* app) |
13 : profile_(profile), app_(app) { | 13 : profile_(profile), app_(app) { |
14 } | 14 } |
15 | 15 |
16 AppInfoPanel::~AppInfoPanel() { | 16 AppInfoPanel::~AppInfoPanel() { |
17 } | 17 } |
18 | 18 |
19 views::Label* AppInfoPanel::CreateHeading(const base::string16& text) const { | 19 views::Label* AppInfoPanel::CreateHeading(const base::string16& text) const { |
20 views::Label* label = new views::Label(text); | 20 views::Label* label = new views::Label(text); |
21 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 21 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
22 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 22 label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
23 ui::ResourceBundle::MediumFont)); | 23 ui::ResourceBundle::MediumFont)); |
24 return label; | 24 return label; |
25 } | 25 } |
26 | 26 |
27 views::View* AppInfoPanel::CreateVerticalStack() const { | 27 views::View* AppInfoPanel::CreateVerticalStack(int child_spacing) const { |
28 views::View* vertically_stacked_view = new views::View(); | 28 views::View* vertically_stacked_view = new views::View(); |
29 vertically_stacked_view->SetLayoutManager( | 29 vertically_stacked_view->SetLayoutManager( |
30 new views::BoxLayout(views::BoxLayout::kVertical, | 30 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, child_spacing)); |
31 0, | |
32 0, | |
33 views::kRelatedControlVerticalSpacing)); | |
34 return vertically_stacked_view; | 31 return vertically_stacked_view; |
35 } | 32 } |
| 33 |
| 34 views::View* AppInfoPanel::CreateVerticalStack() const { |
| 35 return CreateVerticalStack(views::kRelatedControlVerticalSpacing); |
| 36 } |
| 37 |
| 38 views::View* AppInfoPanel::CreateHorizontalStack(int child_spacing) const { |
| 39 views::View* vertically_stacked_view = new views::View(); |
| 40 vertically_stacked_view->SetLayoutManager( |
| 41 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, child_spacing)); |
| 42 return vertically_stacked_view; |
| 43 } |
| 44 |
| 45 views::View* AppInfoPanel::CreateHorizontalStack() const { |
| 46 return CreateVerticalStack(views::kRelatedControlHorizontalSpacing); |
| 47 } |
OLD | NEW |