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