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/views/mus/platform_window_mus.h" | 5 #include "ui/views/mus/platform_window_mus.h" |
6 | 6 |
7 #include "components/mus/public/cpp/property_type_converters.h" | 7 #include "components/mus/public/cpp/property_type_converters.h" |
8 #include "components/mus/public/cpp/window_property.h" | 8 #include "components/mus/public/cpp/window_property.h" |
9 #include "components/mus/public/interfaces/window_manager.mojom.h" | 9 #include "components/mus/public/interfaces/window_manager.mojom.h" |
10 #include "mojo/converters/input_events/input_events_type_converters.h" | 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 mus_window_(mus_window), | 24 mus_window_(mus_window), |
25 show_state_(mus::mojom::SHOW_STATE_RESTORED), | 25 show_state_(mus::mojom::SHOW_STATE_RESTORED), |
26 has_capture_(false) { | 26 has_capture_(false) { |
27 DCHECK(delegate_); | 27 DCHECK(delegate_); |
28 DCHECK(mus_window_); | 28 DCHECK(mus_window_); |
29 mus_window_->AddObserver(this); | 29 mus_window_->AddObserver(this); |
30 | 30 |
31 // We need accelerated widget numbers to be different for each | 31 // We need accelerated widget numbers to be different for each |
32 // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t | 32 // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t |
33 // has this property. | 33 // has this property. |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) || defined(OS_ANDROID) |
35 delegate_->OnAcceleratedWidgetAvailable( | 35 delegate_->OnAcceleratedWidgetAvailable( |
36 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++), | 36 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++), |
37 mus_window_->viewport_metrics().device_pixel_ratio); | 37 mus_window_->viewport_metrics().device_pixel_ratio); |
38 #else | 38 #else |
39 delegate_->OnAcceleratedWidgetAvailable( | 39 delegate_->OnAcceleratedWidgetAvailable( |
40 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++), | 40 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++), |
41 mus_window_->viewport_metrics().device_pixel_ratio); | 41 mus_window_->viewport_metrics().device_pixel_ratio); |
42 #endif | 42 #endif |
43 } | 43 } |
44 | 44 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 case mus::mojom::SHOW_STATE_IMMERSIVE: | 180 case mus::mojom::SHOW_STATE_IMMERSIVE: |
181 case mus::mojom::SHOW_STATE_PRESENTATION: | 181 case mus::mojom::SHOW_STATE_PRESENTATION: |
182 // This may not be sufficient. | 182 // This may not be sufficient. |
183 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN; | 183 state = ui::PLATFORM_WINDOW_STATE_FULLSCREEN; |
184 break; | 184 break; |
185 } | 185 } |
186 delegate_->OnWindowStateChanged(state); | 186 delegate_->OnWindowStateChanged(state); |
187 } | 187 } |
188 | 188 |
189 } // namespace views | 189 } // namespace views |
OLD | NEW |