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