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

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

Issue 2505973003: harmony: use Harmony sizing for ViewsDelegate sizing functions (Closed)
Patch Set: move constant Created 4 years 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
« no previous file with comments | « chrome/browser/ui/views/harmony/harmony_layout_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/harmony_layout_delegate.h" 5 #include "chrome/browser/ui/views/harmony/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 9
10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ = 10 static base::LazyInstance<HarmonyLayoutDelegate> harmony_layout_delegate_ =
11 LAZY_INSTANCE_INITIALIZER; 11 LAZY_INSTANCE_INITIALIZER;
12 12
13 // static 13 // static
14 HarmonyLayoutDelegate* HarmonyLayoutDelegate::Get() { 14 HarmonyLayoutDelegate* HarmonyLayoutDelegate::Get() {
15 return harmony_layout_delegate_.Pointer(); 15 return harmony_layout_delegate_.Pointer();
16 } 16 }
17 17
18 int HarmonyLayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const { 18 int HarmonyLayoutDelegate::GetLayoutDistance(LayoutDistanceType type) const {
19 const int kLayoutUnit = 16;
20 switch (type) { 19 switch (type) {
21 case LayoutDistanceType::PANEL_VERT_MARGIN: 20 case LayoutDistanceType::PANEL_VERT_MARGIN:
22 return kLayoutUnit; 21 return kHarmonyLayoutUnit;
23 case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING: 22 case LayoutDistanceType::RELATED_BUTTON_HORIZONTAL_SPACING:
24 return kLayoutUnit / 2; 23 return kHarmonyLayoutUnit / 2;
25 case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING: 24 case LayoutDistanceType::RELATED_CONTROL_HORIZONTAL_SPACING:
26 return kLayoutUnit; 25 return kHarmonyLayoutUnit;
27 case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING: 26 case LayoutDistanceType::RELATED_CONTROL_VERTICAL_SPACING:
28 return kLayoutUnit / 2; 27 return kHarmonyLayoutUnit / 2;
29 case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING: 28 case LayoutDistanceType::UNRELATED_CONTROL_VERTICAL_SPACING:
30 return kLayoutUnit; 29 return kHarmonyLayoutUnit;
31 case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING: 30 case LayoutDistanceType::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING:
32 return kLayoutUnit; 31 return kHarmonyLayoutUnit;
33 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW: 32 case LayoutDistanceType::BUTTON_VEDGE_MARGIN_NEW:
34 return kLayoutUnit; 33 return kHarmonyLayoutUnit;
35 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW: 34 case LayoutDistanceType::BUTTON_HEDGE_MARGIN_NEW:
36 return kLayoutUnit; 35 return kHarmonyLayoutUnit;
37 } 36 }
38 NOTREACHED(); 37 NOTREACHED();
39 return 0; 38 return 0;
40 } 39 }
41 40
42 bool HarmonyLayoutDelegate::UseExtraDialogPadding() const { 41 bool HarmonyLayoutDelegate::UseExtraDialogPadding() const {
43 return false; 42 return false;
44 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/harmony/harmony_layout_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698