| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/aura_init.h" | 5 #include "ui/views/mus/aura_init.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 Widget::InitParams* params, | 45 Widget::InitParams* params, |
| 46 internal::NativeWidgetDelegate* delegate) override {} | 46 internal::NativeWidgetDelegate* delegate) override {} |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 AuraInit::AuraInit(mojo::Connector* connector, const std::string& resource_file) | 53 AuraInit::AuraInit(mojo::Connector* connector, const std::string& resource_file) |
| 54 : resource_file_(resource_file), | 54 : resource_file_(resource_file), |
| 55 env_(aura::Env::CreateInstance()), |
| 55 views_delegate_(new MusViewsDelegate) { | 56 views_delegate_(new MusViewsDelegate) { |
| 56 aura::Env::CreateInstance(false); | |
| 57 | |
| 58 InitializeResources(connector); | 57 InitializeResources(connector); |
| 59 | 58 |
| 60 ui::InitializeInputMethodForTesting(); | 59 ui::InitializeInputMethodForTesting(); |
| 61 } | 60 } |
| 62 | 61 |
| 63 AuraInit::~AuraInit() { | 62 AuraInit::~AuraInit() { |
| 64 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 63 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
| 65 if (font_loader_.get()) { | 64 if (font_loader_.get()) { |
| 66 SkFontConfigInterface::SetGlobal(nullptr); | 65 SkFontConfigInterface::SetGlobal(nullptr); |
| 67 // FontLoader is ref counted. We need to explicitly shutdown the background | 66 // FontLoader is ref counted. We need to explicitly shutdown the background |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 font_loader_ = skia::AdoptRef(new font_service::FontLoader(connector)); | 91 font_loader_ = skia::AdoptRef(new font_service::FontLoader(connector)); |
| 93 SkFontConfigInterface::SetGlobal(font_loader_.get()); | 92 SkFontConfigInterface::SetGlobal(font_loader_.get()); |
| 94 #endif | 93 #endif |
| 95 | 94 |
| 96 // There is a bunch of static state in gfx::Font, by running this now, | 95 // There is a bunch of static state in gfx::Font, by running this now, |
| 97 // before any other apps load, we ensure all the state is set up. | 96 // before any other apps load, we ensure all the state is set up. |
| 98 gfx::Font(); | 97 gfx::Font(); |
| 99 } | 98 } |
| 100 | 99 |
| 101 } // namespace views | 100 } // namespace views |
| OLD | NEW |