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

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

Issue 2968713003: Harmonize the find in page dialog. (Closed)
Patch Set: format fixes Created 3 years, 5 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 27 matching lines...) Expand all
38 case DISTANCE_RELATED_LABEL_HORIZONTAL_LIST: 38 case DISTANCE_RELATED_LABEL_HORIZONTAL_LIST:
39 return 8; 39 return 8;
40 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: 40 case DISTANCE_SUBSECTION_HORIZONTAL_INDENT:
41 return 10; 41 return 10;
42 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: 42 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL:
43 return 12; 43 return 12;
44 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: 44 case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE:
45 return 20; 45 return 20;
46 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: 46 case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE:
47 return 30; 47 return 30;
48 case DISTANCE_TOAST_CONTROL_VERTICAL:
49 return 8;
50 case DISTANCE_TOAST_LABEL_VERTICAL:
51 return 12;
48 default: 52 default:
49 return views::LayoutProvider::GetDistanceMetric(metric); 53 return views::LayoutProvider::GetDistanceMetric(metric);
50 } 54 }
51 } 55 }
52 56
53 const views::TypographyProvider& ChromeLayoutProvider::GetTypographyProvider() 57 const views::TypographyProvider& ChromeLayoutProvider::GetTypographyProvider()
54 const { 58 const {
55 // This is not a data member because then HarmonyLayoutProvider would inherit 59 // This is not a data member because then HarmonyLayoutProvider would inherit
56 // it, even when it provides its own. 60 // it, even when it provides its own.
57 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); 61 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ());
58 return legacy_provider; 62 return legacy_provider;
59 } 63 }
60 64
65 gfx::Insets ChromeLayoutProvider::GetInsetsMetric(int metric) const {
66 DCHECK_LT(metric, views::VIEWS_INSETS_MAX);
Peter Kasting 2017/07/15 07:38:36 No need for this line, the base class checks it
ananta 2017/07/17 19:11:04 Done.
67 switch (metric) {
68 case InsetsMetric::INSETS_TOAST:
69 return gfx::Insets(0, 8);
70 default:
71 return views::LayoutProvider::GetInsetsMetric(metric);
72 }
73 }
74
61 views::GridLayout::Alignment 75 views::GridLayout::Alignment
62 ChromeLayoutProvider::GetControlLabelGridAlignment() const { 76 ChromeLayoutProvider::GetControlLabelGridAlignment() const {
63 return views::GridLayout::TRAILING; 77 return views::GridLayout::TRAILING;
64 } 78 }
65 79
66 bool ChromeLayoutProvider::UseExtraDialogPadding() const { 80 bool ChromeLayoutProvider::UseExtraDialogPadding() const {
67 return true; 81 return true;
68 } 82 }
69 83
70 bool ChromeLayoutProvider::ShouldShowWindowIcon() const { 84 bool ChromeLayoutProvider::ShouldShowWindowIcon() const {
71 return true; 85 return true;
72 } 86 }
73 87
74 bool ChromeLayoutProvider::IsHarmonyMode() const { 88 bool ChromeLayoutProvider::IsHarmonyMode() const {
75 return false; 89 return false;
76 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698