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