Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Side by Side Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc

Issue 2907933002: Views/Harmony Remove references to ui/views/layout/layout_constants.h (Closed)
Patch Set: Remove unused dialog_insets Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/ui/browser_navigator.h" 7 #include "chrome/browser/ui/browser_navigator.h"
8 #include "chrome/browser/ui/browser_navigator_params.h" 8 #include "chrome/browser/ui/browser_navigator_params.h"
9 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
9 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/views/controls/label.h" 11 #include "ui/views/controls/label.h"
11 #include "ui/views/layout/box_layout.h" 12 #include "ui/views/layout/box_layout.h"
12 #include "ui/views/layout/layout_constants.h"
13 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 namespace { 16 namespace {
17 17
18 // The spacing between the key and the value labels in the Details section. 18 // The spacing between the key and the value labels in the Details section.
19 const int kSpacingBetweenKeyAndStartOfValue = 3; 19 const int kSpacingBetweenKeyAndStartOfValue = 3;
20 } 20 }
21 21
22 AppInfoPanel::AppInfoPanel(Profile* profile, const extensions::Extension* app) 22 AppInfoPanel::AppInfoPanel(Profile* profile, const extensions::Extension* app)
(...skipping 22 matching lines...) Expand all
45 } 45 }
46 46
47 views::View* AppInfoPanel::CreateVerticalStack(int child_spacing) const { 47 views::View* AppInfoPanel::CreateVerticalStack(int child_spacing) const {
48 views::View* vertically_stacked_view = new views::View(); 48 views::View* vertically_stacked_view = new views::View();
49 vertically_stacked_view->SetLayoutManager( 49 vertically_stacked_view->SetLayoutManager(
50 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, child_spacing)); 50 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, child_spacing));
51 return vertically_stacked_view; 51 return vertically_stacked_view;
52 } 52 }
53 53
54 views::View* AppInfoPanel::CreateVerticalStack() const { 54 views::View* AppInfoPanel::CreateVerticalStack() const {
55 return CreateVerticalStack(views::kRelatedControlVerticalSpacing); 55 return CreateVerticalStack(ChromeLayoutProvider::Get()->GetDistanceMetric(
56 views::DISTANCE_RELATED_CONTROL_VERTICAL));
56 } 57 }
57 58
58 views::View* AppInfoPanel::CreateHorizontalStack(int child_spacing) const { 59 views::View* AppInfoPanel::CreateHorizontalStack(int child_spacing) const {
59 views::View* vertically_stacked_view = new views::View(); 60 views::View* vertically_stacked_view = new views::View();
60 vertically_stacked_view->SetLayoutManager( 61 vertically_stacked_view->SetLayoutManager(
61 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, child_spacing)); 62 new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, child_spacing));
62 return vertically_stacked_view; 63 return vertically_stacked_view;
63 } 64 }
64 65
65 views::View* AppInfoPanel::CreateKeyValueField(views::View* key, 66 views::View* AppInfoPanel::CreateKeyValueField(views::View* key,
66 views::View* value) const { 67 views::View* value) const {
67 views::View* horizontal_stack = 68 views::View* horizontal_stack =
68 CreateHorizontalStack(kSpacingBetweenKeyAndStartOfValue); 69 CreateHorizontalStack(kSpacingBetweenKeyAndStartOfValue);
69 horizontal_stack->AddChildView(key); 70 horizontal_stack->AddChildView(key);
70 horizontal_stack->AddChildView(value); 71 horizontal_stack->AddChildView(value);
71 return horizontal_stack; 72 return horizontal_stack;
72 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698