OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_provider.h" | 5 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" |
6 | 6 |
7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { | 7 gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { |
8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); | 8 DCHECK_LT(metric, views::VIEWS_INSETS_MAX); |
9 switch (metric) { | 9 switch (metric) { |
10 case views::INSETS_DIALOG_BUTTON: | 10 case views::INSETS_DIALOG_BUTTON: |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 89 |
90 bool HarmonyLayoutProvider::ShouldShowWindowIcon() const { | 90 bool HarmonyLayoutProvider::ShouldShowWindowIcon() const { |
91 return false; | 91 return false; |
92 } | 92 } |
93 | 93 |
94 bool HarmonyLayoutProvider::IsHarmonyMode() const { | 94 bool HarmonyLayoutProvider::IsHarmonyMode() const { |
95 return true; | 95 return true; |
96 } | 96 } |
97 | 97 |
98 int HarmonyLayoutProvider::GetSnappedDialogWidth(int min_width) const { | 98 int HarmonyLayoutProvider::GetSnappedDialogWidth(int min_width) const { |
99 for (int snap_point : {320, 448, 512}) { | 99 for (int snap_point : {220, 320, 448, 512}) { |
Peter Kasting
2017/04/28 05:58:48
Don't add this, as this isn't a Harmony snap point
varkha
2017/04/28 06:21:19
Yes the dialog was snapping to 320 and this went a
Peter Kasting
2017/04/28 06:47:26
One problem is that this isn't a snap width in the
varkha
2017/05/01 10:11:59
Done.
| |
100 if (min_width <= snap_point) | 100 if (min_width <= snap_point) |
101 return snap_point; | 101 return snap_point; |
102 } | 102 } |
103 | 103 |
104 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * | 104 return ((min_width + kHarmonyLayoutUnit - 1) / kHarmonyLayoutUnit) * |
105 kHarmonyLayoutUnit; | 105 kHarmonyLayoutUnit; |
106 } | 106 } |
107 | 107 |
108 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() | 108 const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() |
109 const { | 109 const { |
110 return typography_provider_; | 110 return typography_provider_; |
111 } | 111 } |
OLD | NEW |