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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 return true; | 78 return true; |
78 } | 79 } |
79 | 80 |
80 bool LayoutDelegate::IsHarmonyMode() const { | 81 bool LayoutDelegate::IsHarmonyMode() const { |
81 return false; | 82 return false; |
82 } | 83 } |
83 | 84 |
84 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { | 85 int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { |
85 return 0; | 86 return 0; |
86 } | 87 } |
88 | |
89 const views::TypographyProvider& LayoutDelegate::GetTypographyProvider() const { | |
90 // HarmonyLayoutDelegate inherits from |this| and shouldn't inherit a | |
91 // LegacyTypographyProvider. | |
Peter Kasting
2017/03/17 02:26:00
I'm confused by this comment. HarmonyLayoutDelega
tapted
2017/03/17 10:33:10
Sorry - yes, this was pretty unclear (static here
Peter Kasting
2017/03/17 20:59:39
Ah. That's fine if you want. I think the comment
| |
92 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); | |
93 return legacy_provider; | |
94 } | |
OLD | NEW |