OLD | NEW |
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/chrome_views_delegate.h" | 9 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 10 #include "chrome/browser/ui/views/harmony/chrome_typography.h" |
10 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" | 11 #include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" |
11 #include "ui/base/material_design/material_design_controller.h" | 12 #include "ui/base/material_design/material_design_controller.h" |
12 #include "ui/views/layout/layout_constants.h" | 13 #include "ui/views/layout/layout_constants.h" |
13 | 14 |
14 static base::LazyInstance<LayoutDelegate>::DestructorAtExit layout_delegate_ = | 15 static base::LazyInstance<LayoutDelegate>::DestructorAtExit layout_delegate_ = |
15 LAZY_INSTANCE_INITIALIZER; | 16 LAZY_INSTANCE_INITIALIZER; |
16 | 17 |
17 // static | 18 // static |
18 LayoutDelegate* LayoutDelegate::Get() { | 19 LayoutDelegate* LayoutDelegate::Get() { |
19 return ui::MaterialDesignController::IsSecondaryUiMaterial() | 20 return ui::MaterialDesignController::IsSecondaryUiMaterial() |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return true; | 82 return true; |
82 } | 83 } |
83 | 84 |
84 bool LayoutDelegate::IsHarmonyMode() const { | 85 bool LayoutDelegate::IsHarmonyMode() const { |
85 return false; | 86 return false; |
86 } | 87 } |
87 | 88 |
88 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { | 89 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { |
89 return 0; | 90 return 0; |
90 } | 91 } |
| 92 |
| 93 const views::TypographyProvider& LayoutDelegate::GetTypographyProvider() const { |
| 94 // This is not a data member because then HarmonyLayoutDelegate would inherit |
| 95 // it, even when it provides its own. |
| 96 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); |
| 97 return legacy_provider; |
| 98 } |
OLD | NEW |