| 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/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 ash::Shell::GetInstance()->display_configuration_controller(); | 295 ash::Shell::GetInstance()->display_configuration_controller(); |
| 296 | 296 |
| 297 const gfx::Display target = GetTargetDisplay(display_id_str, display_manager); | 297 const gfx::Display target = GetTargetDisplay(display_id_str, display_manager); |
| 298 | 298 |
| 299 if (target.id() == gfx::Display::kInvalidDisplayID) { | 299 if (target.id() == gfx::Display::kInvalidDisplayID) { |
| 300 *error = "Display not found."; | 300 *error = "Display not found."; |
| 301 return false; | 301 return false; |
| 302 } | 302 } |
| 303 | 303 |
| 304 int64_t display_id = target.id(); | 304 int64_t display_id = target.id(); |
| 305 // TODO(scottmg): Native is wrong http://crbug.com/133312 | 305 const gfx::Display& primary = gfx::Screen::GetScreen()->GetPrimaryDisplay(); |
| 306 const gfx::Display& primary = | |
| 307 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | |
| 308 | 306 |
| 309 if (!ValidateParamsForDisplay( | 307 if (!ValidateParamsForDisplay( |
| 310 info, target, display_manager, primary.id(), error)) { | 308 info, target, display_manager, primary.id(), error)) { |
| 311 return false; | 309 return false; |
| 312 } | 310 } |
| 313 | 311 |
| 314 // Process 'isPrimary' parameter. | 312 // Process 'isPrimary' parameter. |
| 315 if (info.is_primary && *info.is_primary && target.id() != primary.id()) { | 313 if (info.is_primary && *info.is_primary && target.id() != primary.id()) { |
| 316 display_configuration_controller->SetPrimaryDisplayId( | 314 display_configuration_controller->SetPrimaryDisplayId( |
| 317 display_id, false /* user_action */); | 315 display_id, false /* user_action */); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 413 } |
| 416 return all_displays; | 414 return all_displays; |
| 417 } | 415 } |
| 418 | 416 |
| 419 // static | 417 // static |
| 420 DisplayInfoProvider* DisplayInfoProvider::Create() { | 418 DisplayInfoProvider* DisplayInfoProvider::Create() { |
| 421 return new DisplayInfoProviderChromeOS(); | 419 return new DisplayInfoProviderChromeOS(); |
| 422 } | 420 } |
| 423 | 421 |
| 424 } // namespace extensions | 422 } // namespace extensions |
| OLD | NEW |