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); | |
339 } | 338 } |
340 | 339 |
341 // Process new display origin parameters. | 340 // Process new display origin parameters. |
342 gfx::Point new_bounds_origin = target.bounds().origin(); | 341 gfx::Point new_bounds_origin = target.bounds().origin(); |
343 if (info.bounds_origin_x) | 342 if (info.bounds_origin_x) |
344 new_bounds_origin.set_x(*info.bounds_origin_x); | 343 new_bounds_origin.set_x(*info.bounds_origin_x); |
345 if (info.bounds_origin_y) | 344 if (info.bounds_origin_y) |
346 new_bounds_origin.set_y(*info.bounds_origin_y); | 345 new_bounds_origin.set_y(*info.bounds_origin_y); |
347 | 346 |
348 if (new_bounds_origin != target.bounds().origin()) { | 347 if (new_bounds_origin != target.bounds().origin()) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 gfx::Screen* DisplayInfoProviderChromeOS::GetActiveScreen() { | 384 gfx::Screen* DisplayInfoProviderChromeOS::GetActiveScreen() { |
386 return ash::Shell::GetScreen(); | 385 return ash::Shell::GetScreen(); |
387 } | 386 } |
388 | 387 |
389 // static | 388 // static |
390 DisplayInfoProvider* DisplayInfoProvider::Create() { | 389 DisplayInfoProvider* DisplayInfoProvider::Create() { |
391 return new DisplayInfoProviderChromeOS(); | 390 return new DisplayInfoProviderChromeOS(); |
392 } | 391 } |
393 | 392 |
394 } // namespace extensions | 393 } // namespace extensions |
OLD | NEW |