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 "ui/mojo/init/ui_init.h" | 5 #include "ui/mojo/init/ui_init.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "ui/mojo/init/screen_mojo.h" | 10 #include "ui/mojo/init/screen_mojo.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 ~GestureConfigurationMojo() override {} | 37 ~GestureConfigurationMojo() override {} |
38 | 38 |
39 private: | 39 private: |
40 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationMojo); | 40 DISALLOW_COPY_AND_ASSIGN(GestureConfigurationMojo); |
41 }; | 41 }; |
42 #endif | 42 #endif |
43 | 43 |
44 UIInit::UIInit(const std::vector<gfx::Display>& displays) | 44 UIInit::UIInit(const std::vector<gfx::Display>& displays) |
45 : screen_(new ScreenMojo(displays)) { | 45 : screen_(new ScreenMojo(displays)) { |
46 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 46 gfx::Screen::SetScreenInstance(screen_.get()); |
47 #if defined(OS_ANDROID) | 47 #if defined(OS_ANDROID) |
48 gesture_configuration_.reset(new GestureConfigurationMojo); | 48 gesture_configuration_.reset(new GestureConfigurationMojo); |
49 ui::GestureConfiguration::SetInstance(gesture_configuration_.get()); | 49 ui::GestureConfiguration::SetInstance(gesture_configuration_.get()); |
50 #endif | 50 #endif |
51 } | 51 } |
52 | 52 |
53 UIInit::~UIInit() { | 53 UIInit::~UIInit() { |
54 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); | 54 gfx::Screen::SetScreenInstance(nullptr); |
55 #if defined(OS_ANDROID) | 55 #if defined(OS_ANDROID) |
56 ui::GestureConfiguration::SetInstance(nullptr); | 56 ui::GestureConfiguration::SetInstance(nullptr); |
57 #endif | 57 #endif |
58 } | 58 } |
59 | 59 |
60 } // namespace mojo | 60 } // namespace mojo |
61 } // namespace ui | 61 } // namespace ui |
OLD | NEW |