Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: mandoline/ui/aura/aura_init.cc

Issue 1293013002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mandoline/ui/aura/aura_init.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mandoline/ui/aura/aura_init.h ('k') | ui/aura/bench/bench_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698