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 <string> | 10 #include <string> |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 const base::ListValue* args) { | 406 const base::ListValue* args) { |
407 const base::ListValue* layouts = nullptr; | 407 const base::ListValue* layouts = nullptr; |
408 if (!args->GetList(0, &layouts)) | 408 if (!args->GetList(0, &layouts)) |
409 NOTREACHED(); | 409 NOTREACHED(); |
410 content::RecordAction(base::UserMetricsAction("Options_DisplayRearrange")); | 410 content::RecordAction(base::UserMetricsAction("Options_DisplayRearrange")); |
411 | 411 |
412 ash::DisplayManager* display_manager = GetDisplayManager(); | 412 ash::DisplayManager* display_manager = GetDisplayManager(); |
413 display::DisplayLayoutBuilder builder( | 413 display::DisplayLayoutBuilder builder( |
414 display_manager->GetCurrentDisplayLayout()); | 414 display_manager->GetCurrentDisplayLayout()); |
415 builder.ClearPlacements(); | 415 builder.ClearPlacements(); |
416 for (const base::Value* layout : *layouts) { | 416 for (const auto& layout : *layouts) { |
417 const base::DictionaryValue* dictionary; | 417 const base::DictionaryValue* dictionary; |
418 if (!layout->GetAsDictionary(&dictionary)) { | 418 if (!layout->GetAsDictionary(&dictionary)) { |
419 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary; | 419 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary; |
420 continue; | 420 continue; |
421 } | 421 } |
422 | 422 |
423 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId"); | 423 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId"); |
424 if (parent_id == display::Display::kInvalidDisplayID) | 424 if (parent_id == display::Display::kInvalidDisplayID) |
425 continue; // No placement for root (primary) display. | 425 continue; // No placement for root (primary) display. |
426 | 426 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 bool enable = false; | 555 bool enable = false; |
556 if (!args->GetBoolean(0, &enable)) | 556 if (!args->GetBoolean(0, &enable)) |
557 NOTREACHED(); | 557 NOTREACHED(); |
558 | 558 |
559 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( | 559 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( |
560 enable ? ash::DisplayManager::UNIFIED : ash::DisplayManager::EXTENDED); | 560 enable ? ash::DisplayManager::UNIFIED : ash::DisplayManager::EXTENDED); |
561 } | 561 } |
562 | 562 |
563 } // namespace options | 563 } // namespace options |
564 } // namespace chromeos | 564 } // namespace chromeos |
OLD | NEW |