Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(945)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/display_options_handler.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (!args->GetList(0, &layouts)) 427 if (!args->GetList(0, &layouts))
428 NOTREACHED(); 428 NOTREACHED();
429 base::RecordAction(base::UserMetricsAction("Options_DisplayRearrange")); 429 base::RecordAction(base::UserMetricsAction("Options_DisplayRearrange"));
430 430
431 display::DisplayManager* display_manager = GetDisplayManager(); 431 display::DisplayManager* display_manager = GetDisplayManager();
432 display::DisplayLayoutBuilder builder( 432 display::DisplayLayoutBuilder builder(
433 display_manager->GetCurrentDisplayLayout()); 433 display_manager->GetCurrentDisplayLayout());
434 builder.ClearPlacements(); 434 builder.ClearPlacements();
435 for (const auto& layout : *layouts) { 435 for (const auto& layout : *layouts) {
436 const base::DictionaryValue* dictionary; 436 const base::DictionaryValue* dictionary;
437 if (!layout.GetAsDictionary(&dictionary)) { 437 if (!layout->GetAsDictionary(&dictionary)) {
438 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary; 438 LOG(ERROR) << "Invalid layout dictionary: " << *dictionary;
439 continue; 439 continue;
440 } 440 }
441 441
442 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId"); 442 int64_t parent_id = GetDisplayIdFromDictionary(dictionary, "parentId");
443 if (parent_id == display::kInvalidDisplayId) 443 if (parent_id == display::kInvalidDisplayId)
444 continue; // No placement for root (primary) display. 444 continue; // No placement for root (primary) display.
445 445
446 int64_t display_id = GetDisplayIdFromDictionary(dictionary, "id"); 446 int64_t display_id = GetDisplayIdFromDictionary(dictionary, "id");
447 if (display_id == display::kInvalidDisplayId) { 447 if (display_id == display::kInvalidDisplayId) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 if (!args->GetBoolean(0, &enable)) 569 if (!args->GetBoolean(0, &enable))
570 NOTREACHED(); 570 NOTREACHED();
571 571
572 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( 572 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays(
573 enable ? display::DisplayManager::UNIFIED 573 enable ? display::DisplayManager::UNIFIED
574 : display::DisplayManager::EXTENDED); 574 : display::DisplayManager::EXTENDED);
575 } 575 }
576 576
577 } // namespace options 577 } // namespace options
578 } // namespace chromeos 578 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698