OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/extensions/display_info_provider_chromeos.h" | 5 #include "chrome/browser/extensions/display_info_provider_chromeos.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 display_manager->SetOverscanInsets(display_id, | 327 display_manager->SetOverscanInsets(display_id, |
328 gfx::Insets(info.overscan->top, | 328 gfx::Insets(info.overscan->top, |
329 info.overscan->left, | 329 info.overscan->left, |
330 info.overscan->bottom, | 330 info.overscan->bottom, |
331 info.overscan->right)); | 331 info.overscan->right)); |
332 } | 332 } |
333 | 333 |
334 // Process 'rotation' parameter. | 334 // Process 'rotation' parameter. |
335 if (info.rotation) { | 335 if (info.rotation) { |
336 display_manager->SetDisplayRotation(display_id, | 336 display_manager->SetDisplayRotation(display_id, |
337 DegreesToRotation(*info.rotation)); | 337 DegreesToRotation(*info.rotation), |
| 338 gfx::Display::ROTATION_SOURCE_ACTIVE); |
338 } | 339 } |
339 | 340 |
340 // Process new display origin parameters. | 341 // Process new display origin parameters. |
341 gfx::Point new_bounds_origin = target.bounds().origin(); | 342 gfx::Point new_bounds_origin = target.bounds().origin(); |
342 if (info.bounds_origin_x) | 343 if (info.bounds_origin_x) |
343 new_bounds_origin.set_x(*info.bounds_origin_x); | 344 new_bounds_origin.set_x(*info.bounds_origin_x); |
344 if (info.bounds_origin_y) | 345 if (info.bounds_origin_y) |
345 new_bounds_origin.set_y(*info.bounds_origin_y); | 346 new_bounds_origin.set_y(*info.bounds_origin_y); |
346 | 347 |
347 if (new_bounds_origin != target.bounds().origin()) { | 348 if (new_bounds_origin != target.bounds().origin()) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 gfx::Screen* DisplayInfoProviderChromeOS::GetActiveScreen() { | 385 gfx::Screen* DisplayInfoProviderChromeOS::GetActiveScreen() { |
385 return ash::Shell::GetScreen(); | 386 return ash::Shell::GetScreen(); |
386 } | 387 } |
387 | 388 |
388 // static | 389 // static |
389 DisplayInfoProvider* DisplayInfoProvider::Create() { | 390 DisplayInfoProvider* DisplayInfoProvider::Create() { |
390 return new DisplayInfoProviderChromeOS(); | 391 return new DisplayInfoProviderChromeOS(); |
391 } | 392 } |
392 | 393 |
393 } // namespace extensions | 394 } // namespace extensions |
OLD | NEW |