| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // display. | 160 // display. |
| 161 void UpdateDisplayLayout(const gfx::Rect& primary_display_bounds, | 161 void UpdateDisplayLayout(const gfx::Rect& primary_display_bounds, |
| 162 int64_t primary_display_id, | 162 int64_t primary_display_id, |
| 163 const gfx::Rect& target_display_bounds, | 163 const gfx::Rect& target_display_bounds, |
| 164 int64_t target_display_id) { | 164 int64_t target_display_id) { |
| 165 ash::DisplayPlacement placement(CreatePlacementForRectangles( | 165 ash::DisplayPlacement placement(CreatePlacementForRectangles( |
| 166 primary_display_bounds, target_display_bounds)); | 166 primary_display_bounds, target_display_bounds)); |
| 167 placement.display_id = target_display_id; | 167 placement.display_id = target_display_id; |
| 168 placement.parent_display_id = primary_display_id; | 168 placement.parent_display_id = primary_display_id; |
| 169 | 169 |
| 170 scoped_ptr<ash::DisplayLayout> layout(new ash::DisplayLayout); | 170 std::unique_ptr<ash::DisplayLayout> layout(new ash::DisplayLayout); |
| 171 layout->placement_list.push_back(placement); | 171 layout->placement_list.push_back(placement); |
| 172 layout->primary_id = primary_display_id; | 172 layout->primary_id = primary_display_id; |
| 173 | 173 |
| 174 ash::Shell::GetInstance() | 174 ash::Shell::GetInstance() |
| 175 ->display_configuration_controller() | 175 ->display_configuration_controller() |
| 176 ->SetDisplayLayout(std::move(layout), false /* user_action */); | 176 ->SetDisplayLayout(std::move(layout), false /* user_action */); |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Validates that parameters passed to the SetInfo function are valid for the | 179 // Validates that parameters passed to the SetInfo function are valid for the |
| 180 // desired display and the current display manager state. | 180 // desired display and the current display manager state. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 return all_displays; | 416 return all_displays; |
| 417 } | 417 } |
| 418 | 418 |
| 419 // static | 419 // static |
| 420 DisplayInfoProvider* DisplayInfoProvider::Create() { | 420 DisplayInfoProvider* DisplayInfoProvider::Create() { |
| 421 return new DisplayInfoProviderChromeOS(); | 421 return new DisplayInfoProviderChromeOS(); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace extensions | 424 } // namespace extensions |
| OLD | NEW |