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

Side by Side Diff: mojo/views/views_init.cc

Issue 658753004: Make wm_flow_init work with gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: done Created 6 years, 2 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 | « mojo/views/mojo_views_export.h ('k') | mojo/views/views_init_internal.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/views/views_init.h" 5 #include "mojo/views/views_init.h"
6 6
7 #include "mojo/views/views_init_internal.h" 7 #include "base/i18n/icu_util.h"
8 #include "base/lazy_instance.h"
9 #include "base/path_service.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/base/ui_base_paths.h"
8 12
9 namespace mojo { 13 namespace mojo {
14 namespace {
10 15
16 // Used to ensure we only init once.
17 class Setup {
18 public:
19 Setup() {
20 base::i18n::InitializeICU();
21
22 ui::RegisterPathProvider();
23
24 base::FilePath ui_test_pak_path;
25 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
26 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
27
28 // There is a bunch of static state in gfx::Font, by running this now,
29 // before any other apps load, we ensure all the state is set up.
30 gfx::Font();
31 }
32
33 ~Setup() {
34 }
35
36 private:
37 DISALLOW_COPY_AND_ASSIGN(Setup);
38 };
39
40 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER;
41
42 } // namespace
43
44 void InitViews() {
45 setup.Get();
46 }
11 ViewsInit::ViewsInit() { 47 ViewsInit::ViewsInit() {
12 InitViews(); 48 InitViews();
13 } 49 }
14 50
15 ViewsInit::~ViewsInit() { 51 ViewsInit::~ViewsInit() {
16 } 52 }
17 53
18 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/views/mojo_views_export.h ('k') | mojo/views/views_init_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698