| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/chromeos/display_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/display_options_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 if (!args->GetList(0, &layouts)) | 428 if (!args->GetList(0, &layouts)) |
| 429 NOTREACHED(); | 429 NOTREACHED(); |
| 430 content::RecordAction(base::UserMetricsAction("Options_DisplayRearrange")); | 430 content::RecordAction(base::UserMetricsAction("Options_DisplayRearrange")); |
| 431 | 431 |
| 432 display::DisplayManager* display_manager = GetDisplayManager(); | 432 display::DisplayManager* display_manager = GetDisplayManager(); |
| 433 display::DisplayLayoutBuilder builder( | 433 display::DisplayLayoutBuilder builder( |
| 434 display_manager->GetCurrentDisplayLayout()); | 434 display_manager->GetCurrentDisplayLayout()); |
| 435 builder.ClearPlacements(); | 435 builder.ClearPlacements(); |
| 436 for (const auto& layout : *layouts) { | 436 for (const auto& layout : *layouts) { |
| 437 const base::DictionaryValue* dictionary; | 437 const base::DictionaryValue* dictionary; |
| 438 if (!layout->GetAsDictionary(&dictionary)) { | 438 if (!layout.GetAsDictionary(&dictionary)) { |
| 439 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary; | 439 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary; |
| 440 continue; | 440 continue; |
| 441 } | 441 } |
| 442 | 442 |
| 443 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId"); | 443 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId"); |
| 444 if (parent_id == display::kInvalidDisplayId) | 444 if (parent_id == display::kInvalidDisplayId) |
| 445 continue; // No placement for root (primary) display. | 445 continue; // No placement for root (primary) display. |
| 446 | 446 |
| 447 int64_t display_id = GetDisplayIdFromDictionary(dictionary, "id"); | 447 int64_t display_id = GetDisplayIdFromDictionary(dictionary, "id"); |
| 448 if (display_id == display::kInvalidDisplayId) { | 448 if (display_id == display::kInvalidDisplayId) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (!args->GetBoolean(0, &enable)) | 575 if (!args->GetBoolean(0, &enable)) |
| 576 NOTREACHED(); | 576 NOTREACHED(); |
| 577 | 577 |
| 578 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( | 578 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( |
| 579 enable ? display::DisplayManager::UNIFIED | 579 enable ? display::DisplayManager::UNIFIED |
| 580 : display::DisplayManager::EXTENDED); | 580 : display::DisplayManager::EXTENDED); |
| 581 } | 581 } |
| 582 | 582 |
| 583 } // namespace options | 583 } // namespace options |
| 584 } // namespace chromeos | 584 } // namespace chromeos |
| OLD | NEW |