| 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 "mandoline/ui/aura/aura_init.h" | 5 #include "mandoline/ui/aura/aura_init.h" |
| 6 | 6 |
| 7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "mandoline/ui/aura/screen_mojo.h" | 10 #include "mandoline/ui/aura/screen_mojo.h" |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/base/ime/input_method_initializer.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/base/ui_base_paths.h" | 14 #include "ui/base/ui_base_paths.h" |
| 14 | 15 |
| 15 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
| 16 #include "components/resource_provider/public/cpp/resource_loader.h" | 17 #include "components/resource_provider/public/cpp/resource_loader.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 namespace mandoline { | 20 namespace mandoline { |
| 20 | 21 |
| 21 #if defined(OS_ANDROID) | 22 #if defined(OS_ANDROID) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 | 35 |
| 35 } // namespace | 36 } // namespace |
| 36 #endif // defined(OS_ANDROID) | 37 #endif // defined(OS_ANDROID) |
| 37 | 38 |
| 38 AuraInit::AuraInit(mojo::Shell* shell) { | 39 AuraInit::AuraInit(mojo::Shell* shell) { |
| 39 aura::Env::CreateInstance(false); | 40 aura::Env::CreateInstance(false); |
| 40 | 41 |
| 41 screen_.reset(ScreenMojo::Create()); | 42 screen_.reset(ScreenMojo::Create()); |
| 42 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 43 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
| 43 InitializeResources(shell); | 44 InitializeResources(shell); |
| 45 |
| 46 ui::InitializeInputMethodForTesting(); |
| 44 } | 47 } |
| 45 | 48 |
| 46 AuraInit::~AuraInit() { | 49 AuraInit::~AuraInit() { |
| 47 } | 50 } |
| 48 | 51 |
| 49 void AuraInit::InitializeResources(mojo::Shell* shell) { | 52 void AuraInit::InitializeResources(mojo::Shell* shell) { |
| 50 if (ui::ResourceBundle::HasSharedInstance()) | 53 if (ui::ResourceBundle::HasSharedInstance()) |
| 51 return; | 54 return; |
| 52 #if defined(OS_ANDROID) | 55 #if defined(OS_ANDROID) |
| 53 resource_provider::ResourceLoader resource_loader(shell, GetResourcePaths()); | 56 resource_provider::ResourceLoader resource_loader(shell, GetResourcePaths()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 71 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 74 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 72 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 75 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 73 #endif | 76 #endif |
| 74 | 77 |
| 75 // There is a bunch of static state in gfx::Font, by running this now, | 78 // There is a bunch of static state in gfx::Font, by running this now, |
| 76 // before any other apps load, we ensure all the state is set up. | 79 // before any other apps load, we ensure all the state is set up. |
| 77 gfx::Font(); | 80 gfx::Font(); |
| 78 } | 81 } |
| 79 | 82 |
| 80 } // namespace mandoline | 83 } // namespace mandoline |
| OLD | NEW |