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

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

Issue 2932523003: Fix Harmony popover buttons being flush with their content. (Closed)
Patch Set: too much padding for bubbles 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 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/chrome_layout_provider.h" 5 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "chrome/browser/ui/views/harmony/chrome_typography.h" 9 #include "chrome/browser/ui/views/harmony/chrome_typography.h"
10 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" 10 #include "chrome/browser/ui/views/harmony/harmony_layout_provider.h"
(...skipping 12 matching lines...) Expand all
23 ? base::MakeUnique<HarmonyLayoutProvider>() 23 ? base::MakeUnique<HarmonyLayoutProvider>()
24 : base::MakeUnique<ChromeLayoutProvider>(); 24 : base::MakeUnique<ChromeLayoutProvider>();
25 } 25 }
26 26
27 int ChromeLayoutProvider::GetDistanceMetric(int metric) const { 27 int ChromeLayoutProvider::GetDistanceMetric(int metric) const {
28 switch (metric) { 28 switch (metric) {
29 case DISTANCE_BUTTON_MINIMUM_WIDTH: 29 case DISTANCE_BUTTON_MINIMUM_WIDTH:
30 return views::kMinimumButtonWidth; 30 return views::kMinimumButtonWidth;
31 case DISTANCE_CONTROL_LIST_VERTICAL: 31 case DISTANCE_CONTROL_LIST_VERTICAL:
32 return GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL); 32 return GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL);
33 case DISTANCE_DIALOG_BUTTON_TOP:
Bret 2017/06/07 22:52:18 This was unused.
34 return 0;
35 case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL: 33 case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL:
36 return views::kRelatedControlSmallHorizontalSpacing; 34 return views::kRelatedControlSmallHorizontalSpacing;
37 case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL: 35 case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL:
38 return views::kRelatedControlSmallVerticalSpacing; 36 return views::kRelatedControlSmallVerticalSpacing;
39 case DISTANCE_RELATED_LABEL_HORIZONTAL: 37 case DISTANCE_RELATED_LABEL_HORIZONTAL:
40 return views::kItemLabelSpacing; 38 return views::kItemLabelSpacing;
41 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: 39 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT:
42 return views::kCheckboxIndent; 40 return views::kCheckboxIndent;
43 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: 41 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL:
44 return views::kUnrelatedControlHorizontalSpacing; 42 return views::kUnrelatedControlHorizontalSpacing;
(...skipping 25 matching lines...) Expand all
70 return true; 68 return true;
71 } 69 }
72 70
73 bool ChromeLayoutProvider::ShouldShowWindowIcon() const { 71 bool ChromeLayoutProvider::ShouldShowWindowIcon() const {
74 return true; 72 return true;
75 } 73 }
76 74
77 bool ChromeLayoutProvider::IsHarmonyMode() const { 75 bool ChromeLayoutProvider::IsHarmonyMode() const {
78 return false; 76 return false;
79 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698