| 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 // This is not a data member because then HarmonyLayoutDelegate would inherit |
| 91 // it, even when it provides its own. |
| 92 CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); |
| 93 return legacy_provider; |
| 94 } |
| OLD | NEW |