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> |
| 8 |
7 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
8 #include "base/path_service.h" | 10 #include "base/path_service.h" |
9 #include "components/resource_provider/public/cpp/resource_loader.h" | 11 #include "components/resource_provider/public/cpp/resource_loader.h" |
10 #include "mojo/application/public/cpp/application_impl.h" | 12 #include "mojo/application/public/cpp/application_impl.h" |
11 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
12 #include "ui/base/ime/input_method_initializer.h" | 14 #include "ui/base/ime/input_method_initializer.h" |
13 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
14 #include "ui/base/ui_base_paths.h" | 16 #include "ui/base/ui_base_paths.h" |
15 #include "ui/views/views_delegate.h" | 17 #include "ui/views/views_delegate.h" |
16 | 18 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 return; | 75 return; |
74 resource_provider::ResourceLoader resource_loader( | 76 resource_provider::ResourceLoader resource_loader( |
75 app, GetResourcePaths(resource_file_)); | 77 app, GetResourcePaths(resource_file_)); |
76 if (!resource_loader.BlockUntilLoaded()) | 78 if (!resource_loader.BlockUntilLoaded()) |
77 return; | 79 return; |
78 CHECK(resource_loader.loaded()); | 80 CHECK(resource_loader.loaded()); |
79 ui::RegisterPathProvider(); | 81 ui::RegisterPathProvider(); |
80 base::File pak_file = resource_loader.ReleaseFile(resource_file_); | 82 base::File pak_file = resource_loader.ReleaseFile(resource_file_); |
81 base::File pak_file_2 = pak_file.Duplicate(); | 83 base::File pak_file_2 = pak_file.Duplicate(); |
82 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( | 84 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( |
83 pak_file.Pass(), base::MemoryMappedFile::Region::kWholeFile); | 85 std::move(pak_file), base::MemoryMappedFile::Region::kWholeFile); |
84 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 86 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
85 pak_file_2.Pass(), ui::SCALE_FACTOR_100P); | 87 std::move(pak_file_2), ui::SCALE_FACTOR_100P); |
86 | 88 |
87 // Initialize the skia font code to go ask fontconfig underneath. | 89 // Initialize the skia font code to go ask fontconfig underneath. |
88 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 90 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
89 font_loader_ = skia::AdoptRef(new font_service::FontLoader(app->shell())); | 91 font_loader_ = skia::AdoptRef(new font_service::FontLoader(app->shell())); |
90 SkFontConfigInterface::SetGlobal(font_loader_.get()); | 92 SkFontConfigInterface::SetGlobal(font_loader_.get()); |
91 #endif | 93 #endif |
92 | 94 |
93 // 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, |
94 // 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. |
95 gfx::Font(); | 97 gfx::Font(); |
96 } | 98 } |
97 | 99 |
98 } // namespace views | 100 } // namespace views |
OLD | NEW |