Chromium Code Reviews| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "ash/display/display_configuration_controller.h" | 9 #include "ash/display/display_configuration_controller.h" |
| 10 #include "ash/display/resolution_notification_controller.h" | 10 #include "ash/display/resolution_notification_controller.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 display::Screen::GetScreen()->GetPrimaryDisplay(); | 468 display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 469 | 469 |
| 470 if (!ValidateParamsForDisplay(info, target, display_manager, primary.id(), | 470 if (!ValidateParamsForDisplay(info, target, display_manager, primary.id(), |
| 471 error)) { | 471 error)) { |
| 472 return false; | 472 return false; |
| 473 } | 473 } |
| 474 | 474 |
| 475 // Process 'isPrimary' parameter. | 475 // Process 'isPrimary' parameter. |
| 476 if (info.is_primary && *info.is_primary && target.id() != primary.id()) { | 476 if (info.is_primary && *info.is_primary && target.id() != primary.id()) { |
| 477 display_configuration_controller->SetPrimaryDisplayId( | 477 display_configuration_controller->SetPrimaryDisplayId( |
| 478 display_id, true /* user_action */); | 478 display_id, true /* user_action */); |
|
oshima
2017/03/01 00:47:31
I believe all these user_actions aren't necessary
wutao
2017/03/01 01:06:35
Will clean this up in a separate CL.
| |
| 479 } | 479 } |
| 480 | 480 |
| 481 // Process 'mirroringSourceId' parameter. | 481 // Process 'mirroringSourceId' parameter. |
| 482 if (info.mirroring_source_id) { | 482 if (info.mirroring_source_id) { |
| 483 bool mirror = !info.mirroring_source_id->empty(); | 483 bool mirror = !info.mirroring_source_id->empty(); |
| 484 display_configuration_controller->SetMirrorMode(mirror, | 484 display_configuration_controller->SetMirrorMode(mirror, |
| 485 true /* user_action */); | 485 true /* user_action */); |
| 486 } | 486 } |
| 487 | 487 |
| 488 // Process 'overscan' parameter. | 488 // Process 'overscan' parameter. |
| 489 if (info.overscan) { | 489 if (info.overscan) { |
| 490 display_manager->SetOverscanInsets( | 490 display_manager->SetOverscanInsets( |
| 491 display_id, gfx::Insets(info.overscan->top, info.overscan->left, | 491 display_id, gfx::Insets(info.overscan->top, info.overscan->left, |
| 492 info.overscan->bottom, info.overscan->right)); | 492 info.overscan->bottom, info.overscan->right)); |
| 493 } | 493 } |
| 494 | 494 |
| 495 // Process 'rotation' parameter. | 495 // Process 'rotation' parameter. |
| 496 if (info.rotation) { | 496 if (info.rotation) { |
| 497 display_configuration_controller->SetDisplayRotation( | 497 display_configuration_controller->SetDisplayRotation( |
| 498 display_id, DegreesToRotation(*info.rotation), | 498 display_id, DegreesToRotation(*info.rotation), |
| 499 display::Display::ROTATION_SOURCE_ACTIVE, true /* user_action */); | 499 display::Display::ROTATION_SOURCE_ACTIVE); |
|
oshima
2017/03/01 00:47:31
Thanks, we changed this (used to be false) when we
wutao
2017/03/01 01:06:35
Acknowledged.
| |
| 500 } | 500 } |
| 501 | 501 |
| 502 // Process new display origin parameters. | 502 // Process new display origin parameters. |
| 503 gfx::Point new_bounds_origin = target.bounds().origin(); | 503 gfx::Point new_bounds_origin = target.bounds().origin(); |
| 504 if (info.bounds_origin_x) | 504 if (info.bounds_origin_x) |
| 505 new_bounds_origin.set_x(*info.bounds_origin_x); | 505 new_bounds_origin.set_x(*info.bounds_origin_x); |
| 506 if (info.bounds_origin_y) | 506 if (info.bounds_origin_y) |
| 507 new_bounds_origin.set_y(*info.bounds_origin_y); | 507 new_bounds_origin.set_y(*info.bounds_origin_y); |
| 508 | 508 |
| 509 if (new_bounds_origin != target.bounds().origin()) { | 509 if (new_bounds_origin != target.bounds().origin()) { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 884 touch_calibrator_.reset(new chromeos::TouchCalibratorController); | 884 touch_calibrator_.reset(new chromeos::TouchCalibratorController); |
| 885 return touch_calibrator_.get(); | 885 return touch_calibrator_.get(); |
| 886 } | 886 } |
| 887 | 887 |
| 888 // static | 888 // static |
| 889 DisplayInfoProvider* DisplayInfoProvider::Create() { | 889 DisplayInfoProvider* DisplayInfoProvider::Create() { |
| 890 return new DisplayInfoProviderChromeOS(); | 890 return new DisplayInfoProviderChromeOS(); |
| 891 } | 891 } |
| 892 | 892 |
| 893 } // namespace extensions | 893 } // namespace extensions |
| OLD | NEW |