| 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 "components/resource_provider/public/cpp/resource_loader.h" | 10 #include "components/resource_provider/public/cpp/resource_loader.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return paths; | 28 return paths; |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 // TODO(sky): the 1.f should be view->viewport_metrics().device_scale_factor, | 33 // TODO(sky): the 1.f should be view->viewport_metrics().device_scale_factor, |
| 34 // but that causes clipping problems. No doubt we're not scaling a size | 34 // but that causes clipping problems. No doubt we're not scaling a size |
| 35 // correctly. | 35 // correctly. |
| 36 AuraInit::AuraInit(mojo::View* view, mojo::Shell* shell) | 36 AuraInit::AuraInit(mojo::View* view, mojo::Shell* shell) |
| 37 : ui_init_(view->viewport_metrics().size_in_pixels.To<gfx::Size>(), 1.f) { | 37 : ui_init_(view->viewport_metrics().size_in_pixels.To<gfx::Size>(), 1.f) { |
| 38 aura::Env::CreateInstance(false); | 38 env_ = aura::Env::CreateInstance(); |
| 39 | 39 |
| 40 InitializeResources(shell); | 40 InitializeResources(shell); |
| 41 | 41 |
| 42 ui::InitializeInputMethodForTesting(); | 42 ui::InitializeInputMethodForTesting(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 AuraInit::~AuraInit() { | 45 AuraInit::~AuraInit() { |
| 46 } | 46 } |
| 47 | 47 |
| 48 void AuraInit::InitializeResources(mojo::Shell* shell) { | 48 void AuraInit::InitializeResources(mojo::Shell* shell) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 59 ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath()); | 59 ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath()); |
| 60 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 60 ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
| 61 resource_loader.ReleaseFile(kResourceUIPak), | 61 resource_loader.ReleaseFile(kResourceUIPak), |
| 62 ui::SCALE_FACTOR_100P); | 62 ui::SCALE_FACTOR_100P); |
| 63 // There is a bunch of static state in gfx::Font, by running this now, | 63 // There is a bunch of static state in gfx::Font, by running this now, |
| 64 // before any other apps load, we ensure all the state is set up. | 64 // before any other apps load, we ensure all the state is set up. |
| 65 gfx::Font(); | 65 gfx::Font(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace mandoline | 68 } // namespace mandoline |
| OLD | NEW |