Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/test/test_views_delegate.h" | 5 #include "ui/views/test/test_views_delegate.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
| 9 | 9 |
| 10 #if !defined(OS_CHROMEOS) | 10 #if !defined(OS_CHROMEOS) |
| 11 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 11 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 12 #endif // !defined(OS_CHROMEOS) | 12 #endif // !defined(OS_CHROMEOS) |
| 13 | 13 |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 | 16 |
| 17 TestViewsDelegate::TestViewsDelegate() | 17 TestViewsDelegate::TestViewsDelegate() |
| 18 : context_factory_(nullptr), | 18 : context_factory_(nullptr), |
| 19 context_factory_private_(nullptr), | 19 context_factory_private_(nullptr), |
| 20 use_desktop_native_widgets_(false), | 20 use_desktop_native_widgets_(false), |
| 21 use_transparent_windows_(false) {} | 21 use_transparent_windows_(false), |
| 22 layout_delegate_(new ViewsLayoutDelegate()) {} | |
|
Peter Kasting
2017/04/04 02:08:56
Nit: Prefer calling MakeUnique to using raw new
kylix_rd
2017/04/04 20:28:23
Done.
| |
| 22 | 23 |
| 23 TestViewsDelegate::~TestViewsDelegate() { | 24 TestViewsDelegate::~TestViewsDelegate() { |
| 24 } | 25 } |
| 25 | 26 |
| 26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 27 HICON TestViewsDelegate::GetSmallWindowIcon() const { | 28 HICON TestViewsDelegate::GetSmallWindowIcon() const { |
| 28 return nullptr; | 29 return nullptr; |
| 29 } | 30 } |
| 30 #endif | 31 #endif |
| 31 | 32 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 52 } | 53 } |
| 53 | 54 |
| 54 ui::ContextFactoryPrivate* TestViewsDelegate::GetContextFactoryPrivate() { | 55 ui::ContextFactoryPrivate* TestViewsDelegate::GetContextFactoryPrivate() { |
| 55 if (context_factory_private_) | 56 if (context_factory_private_) |
| 56 return context_factory_private_; | 57 return context_factory_private_; |
| 57 if (aura::Env::GetInstance()) | 58 if (aura::Env::GetInstance()) |
| 58 return aura::Env::GetInstance()->context_factory_private(); | 59 return aura::Env::GetInstance()->context_factory_private(); |
| 59 return nullptr; | 60 return nullptr; |
| 60 } | 61 } |
| 61 | 62 |
| 62 const TypographyProvider& TestViewsDelegate::GetTypographyProvider() const { | |
| 63 return typography_provider_; | |
| 64 } | |
| 65 | |
| 66 } // namespace views | 63 } // namespace views |
| OLD | NEW |