OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/display/screen_manager_ozone.h" | 5 #include "services/ui/display/screen_manager_ozone.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 display.requested_size = display.supported_sizes[0]; | 140 display.requested_size = display.supported_sizes[0]; |
141 else | 141 else |
142 display.requested_size = display.supported_sizes[i + 1]; | 142 display.requested_size = display.supported_sizes[i + 1]; |
143 break; | 143 break; |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 display_configurator_.OnConfigurationChanged(); | 147 display_configurator_.OnConfigurationChanged(); |
148 } | 148 } |
149 | 149 |
| 150 void ScreenManagerOzone::RotateCurrentDisplay() { |
| 151 NOTIMPLEMENTED(); |
| 152 } |
| 153 |
150 void ScreenManagerOzone::SwapPrimaryDisplay() { | 154 void ScreenManagerOzone::SwapPrimaryDisplay() { |
151 const size_t num_displays = cached_displays_.size(); | 155 const size_t num_displays = cached_displays_.size(); |
152 if (num_displays <= 1) | 156 if (num_displays <= 1) |
153 return; | 157 return; |
154 | 158 |
155 // Find index of current primary display. | 159 // Find index of current primary display. |
156 size_t primary_display_index = 0; | 160 size_t primary_display_index = 0; |
157 for (size_t i = 0; i < num_displays; i++) { | 161 for (size_t i = 0; i < num_displays; i++) { |
158 if (cached_displays_[i].id == primary_display_id_) { | 162 if (cached_displays_[i].id == primary_display_id_) { |
159 primary_display_index = i; | 163 primary_display_index = i; |
160 break; | 164 break; |
161 } | 165 } |
162 } | 166 } |
163 | 167 |
164 // Set next display index as primary, or loop back to first display if last. | 168 // Set next display index as primary, or loop back to first display if last. |
165 if (primary_display_index + 1 == num_displays) { | 169 if (primary_display_index + 1 == num_displays) { |
166 primary_display_id_ = cached_displays_[0].id; | 170 primary_display_id_ = cached_displays_[0].id; |
167 } else { | 171 } else { |
168 primary_display_id_ = cached_displays_[primary_display_index + 1].id; | 172 primary_display_id_ = cached_displays_[primary_display_index + 1].id; |
169 } | 173 } |
170 | 174 |
171 delegate_->OnPrimaryDisplayChanged(primary_display_id_); | 175 delegate_->OnPrimaryDisplayChanged(primary_display_id_); |
172 } | 176 } |
173 | 177 |
| 178 void ScreenManagerOzone::ToggleMirrorMode() { |
| 179 NOTIMPLEMENTED(); |
| 180 } |
| 181 |
| 182 void ScreenManagerOzone::ZoomInternalDisplayUp() { |
| 183 NOTIMPLEMENTED(); |
| 184 } |
| 185 |
| 186 void ScreenManagerOzone::ZoomInternalDisplayDown() { |
| 187 NOTIMPLEMENTED(); |
| 188 } |
| 189 |
| 190 void ScreenManagerOzone::ResetInternalDisplayZoom() { |
| 191 NOTIMPLEMENTED(); |
| 192 } |
| 193 |
174 void ScreenManagerOzone::SetDisplayWorkArea(int64_t display_id, | 194 void ScreenManagerOzone::SetDisplayWorkArea(int64_t display_id, |
175 const gfx::Size& size, | 195 const gfx::Size& size, |
176 const gfx::Insets& insets) { | 196 const gfx::Insets& insets) { |
177 CachedDisplayIterator iter = GetCachedDisplayIterator(display_id); | 197 CachedDisplayIterator iter = GetCachedDisplayIterator(display_id); |
178 if (iter == cached_displays_.end()) { | 198 if (iter == cached_displays_.end()) { |
179 NOTREACHED() << display_id; | 199 NOTREACHED() << display_id; |
180 return; | 200 return; |
181 } | 201 } |
182 | 202 |
183 DisplayInfo& display_info = *iter; | 203 DisplayInfo& display_info = *iter; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return false; | 400 return false; |
381 } | 401 } |
382 | 402 |
383 void ScreenManagerOzone::Create( | 403 void ScreenManagerOzone::Create( |
384 const service_manager::Identity& remote_identity, | 404 const service_manager::Identity& remote_identity, |
385 mojom::TestDisplayControllerRequest request) { | 405 mojom::TestDisplayControllerRequest request) { |
386 test_bindings_.AddBinding(this, std::move(request)); | 406 test_bindings_.AddBinding(this, std::move(request)); |
387 } | 407 } |
388 | 408 |
389 } // namespace display | 409 } // namespace display |
OLD | NEW |