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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 std::string GetAndroidFontsDirectory() { | 56 std::string GetAndroidFontsDirectory() { |
57 std::string android_fonts_dir = | 57 std::string android_fonts_dir = |
58 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 58 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
59 kAndroidFontsPath); | 59 kAndroidFontsPath); |
60 if (android_fonts_dir.size() > 0 && android_fonts_dir.back() != '/') { | 60 if (android_fonts_dir.size() > 0 && android_fonts_dir.back() != '/') { |
61 android_fonts_dir += '/'; | 61 android_fonts_dir += '/'; |
62 } | 62 } |
63 return android_fonts_dir; | 63 return android_fonts_dir; |
64 } | 64 } |
65 | 65 |
66 SkFontMgr* CreateAndroidFontMgr(std::string android_fonts_dir) { | 66 sk_sp<SkFontMgr> CreateAndroidFontMgr(std::string android_fonts_dir) { |
67 SkFontMgr_Android_CustomFonts custom; | 67 SkFontMgr_Android_CustomFonts custom; |
68 custom.fSystemFontUse = | 68 custom.fSystemFontUse = |
69 SkFontMgr_Android_CustomFonts::SystemFontUse::kOnlyCustom; | 69 SkFontMgr_Android_CustomFonts::SystemFontUse::kOnlyCustom; |
70 custom.fBasePath = android_fonts_dir.c_str(); | 70 custom.fBasePath = android_fonts_dir.c_str(); |
71 | 71 |
72 std::string font_config; | 72 std::string font_config; |
73 std::string fallback_font_config; | 73 std::string fallback_font_config; |
74 if (android_fonts_dir.find("kitkat") != std::string::npos) { | 74 if (android_fonts_dir.find("kitkat") != std::string::npos) { |
75 font_config = android_fonts_dir + "system_fonts.xml"; | 75 font_config = android_fonts_dir + "system_fonts.xml"; |
76 fallback_font_config = android_fonts_dir + "fallback_fonts.xml"; | 76 fallback_font_config = android_fonts_dir + "fallback_fonts.xml"; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 std::unique_ptr<blimp::client::BlimpDisplayManagerDelegate> | 164 std::unique_ptr<blimp::client::BlimpDisplayManagerDelegate> |
165 display_manager_delegate = | 165 display_manager_delegate = |
166 base::MakeUnique<blimp::client::BlimpDisplayManagerDelegateMain>(); | 166 base::MakeUnique<blimp::client::BlimpDisplayManagerDelegateMain>(); |
167 blimp::client::BlimpDisplayManager display_manager( | 167 blimp::client::BlimpDisplayManager display_manager( |
168 display_manager_delegate.get(), compositor_dependencies); | 168 display_manager_delegate.get(), compositor_dependencies); |
169 display_manager.SetWindowSize(gfx::Size(kWindowWidth, kWindowHeight)); | 169 display_manager.SetWindowSize(gfx::Size(kWindowWidth, kWindowHeight)); |
170 display_manager.SetBlimpContents(std::move(contents)); | 170 display_manager.SetBlimpContents(std::move(contents)); |
171 | 171 |
172 base::RunLoop().Run(); | 172 base::RunLoop().Run(); |
173 } | 173 } |
OLD | NEW |