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

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

Issue 354513002: A couple of changes that make views work from multiple threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: usage Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « mojo/views/views_init_internal.h ('k') | ui/base/ime/text_input_focus_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/views/views_init_internal.h"
6
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"
12
13 namespace mojo {
14
15 namespace {
16
17 // Used to ensure we only init once.
18 class Setup {
19 public:
20 Setup() {
21 base::i18n::InitializeICU();
22
23 ui::RegisterPathProvider();
24
25 base::FilePath ui_test_pak_path;
26 CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
27 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);
28
29 // There is a bunch of static state in gfx::Font, by running this now,
30 // before any other apps load, we ensure all the state is set up.
31 gfx::Font();
32 }
33
34 ~Setup() {
35 }
36
37 private:
38 DISALLOW_COPY_AND_ASSIGN(Setup);
39 };
40
41 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER;
42
43 } // namespace
44
45 void InitViews() {
46 setup.Get();
47 }
48
49 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/views/views_init_internal.h ('k') | ui/base/ime/text_input_focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698