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

Side by Side Diff: chrome/browser/ui/views/harmony/layout_delegate.cc

Issue 2571613002: Convert Register Protocol Handler dialog for Harmony/Material Design (Closed)
Patch Set: More fixed nits Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/harmony/layout_delegate.h" 5 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" 9 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h"
10 #include "ui/base/material_design/material_design_controller.h" 10 #include "ui/base/material_design/material_design_controller.h"
11 #include "ui/views/layout/layout_constants.h" 11 #include "ui/views/layout/layout_constants.h"
12 12
13 static base::LazyInstance<LayoutDelegate> layout_delegate_ = 13 static base::LazyInstance<LayoutDelegate> layout_delegate_ =
14 LAZY_INSTANCE_INITIALIZER; 14 LAZY_INSTANCE_INITIALIZER;
15 15
16 // static 16 // static
17 LayoutDelegate* LayoutDelegate::Get() { 17 LayoutDelegate* LayoutDelegate::Get() {
18 return ui::MaterialDesignController::IsSecondaryUiMaterial() 18 return ui::MaterialDesignController::IsSecondaryUiMaterial()
19 ? HarmonyLayoutDelegate::Get() 19 ? HarmonyLayoutDelegate::Get()
20 : layout_delegate_.Pointer(); 20 : layout_delegate_.Pointer();
21 } 21 }
22 22
23 int LayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const { 23 int LayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const {
24 switch (type) { 24 switch (type) {
25 case LayoutDistanceType::PANEL_HORIZ_MARGIN:
26 return views::kPanelHorizMargin;
25 case LayoutDistanceType::PANEL_VERT_MARGIN: 27 case LayoutDistanceType::PANEL_VERT_MARGIN:
26 return views::kPanelVertMargin; 28 return views::kPanelVertMargin;
27 case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING: 29 case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING:
28 return views::kRelatedButtonHSpacing; 30 return views::kRelatedButtonHSpacing;
29 case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING: 31 case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING:
30 return views::kRelatedControlHorizontalSpacing; 32 return views::kRelatedControlHorizontalSpacing;
31 case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING: 33 case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING:
32 return views::kRelatedControlVerticalSpacing; 34 return views::kRelatedControlVerticalSpacing;
33 case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING: 35 case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING:
34 return views::kUnrelatedControlVerticalSpacing; 36 return views::kUnrelatedControlVerticalSpacing;
35 case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING: 37 case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING:
36 return views::kUnrelatedControlLargeVerticalSpacing; 38 return views::kUnrelatedControlLargeVerticalSpacing;
37 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: 39 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW:
38 return views::kButtonVEdgeMarginNew; 40 return views::kButtonVEdgeMarginNew;
39 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: 41 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW:
40 return views::kButtonHEdgeMarginNew; 42 return views::kButtonHEdgeMarginNew;
43 case LayoutDistanceType::CHECKBOX_INDENT:
44 return views::kCheckboxIndent;
41 } 45 }
42 NOTREACHED(); 46 NOTREACHED();
43 return 0; 47 return 0;
44 } 48 }
45 49
46 views::GridLayout::Alignment LayoutDelegate::GetControlLabelGridAlignment() 50 views::GridLayout::Alignment LayoutDelegate::GetControlLabelGridAlignment()
47 const { 51 const {
48 return views::GridLayout::TRAILING; 52 return views::GridLayout::TRAILING;
49 } 53 }
50 54
51 bool LayoutDelegate::UseExtraDialogPadding() const { 55 bool LayoutDelegate::UseExtraDialogPadding() const {
52 return true; 56 return true;
53 } 57 }
54 58
55 bool LayoutDelegate::IsHarmonyMode() const { 59 bool LayoutDelegate::IsHarmonyMode() const {
56 return false; 60 return false;
57 } 61 }
58 62
59 int LayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const { 63 int LayoutDelegate::GetDialogPreferredWidth(DialogWidthType type) const {
60 return 0; 64 return 0;
61 } 65 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/harmony/layout_delegate.h ('k') | chrome/browser/ui/views/layout_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698