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

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

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 10 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 <string> 10 #include <string>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 const std::vector<gfx::Display>& displays) { 282 const std::vector<gfx::Display>& displays) {
283 ash::DisplayManager* display_manager = GetDisplayManager(); 283 ash::DisplayManager* display_manager = GetDisplayManager();
284 ash::DisplayManager::MultiDisplayMode display_mode; 284 ash::DisplayManager::MultiDisplayMode display_mode;
285 if (display_manager->IsInMirrorMode()) 285 if (display_manager->IsInMirrorMode())
286 display_mode = ash::DisplayManager::MIRRORING; 286 display_mode = ash::DisplayManager::MIRRORING;
287 else if (display_manager->IsInUnifiedMode()) 287 else if (display_manager->IsInUnifiedMode())
288 display_mode = ash::DisplayManager::UNIFIED; 288 display_mode = ash::DisplayManager::UNIFIED;
289 else 289 else
290 display_mode = ash::DisplayManager::EXTENDED; 290 display_mode = ash::DisplayManager::EXTENDED;
291 base::FundamentalValue mode(static_cast<int>(display_mode)); 291 base::FundamentalValue mode(static_cast<int>(display_mode));
292 int64_t primary_id = ash::Shell::GetScreen()->GetPrimaryDisplay().id(); 292 int64_t primary_id = gfx::Screen::GetScreen()->GetPrimaryDisplay().id();
293 base::ListValue js_displays; 293 base::ListValue js_displays;
294 for (const gfx::Display& display : displays) { 294 for (const gfx::Display& display : displays) {
295 const ash::DisplayInfo& display_info = 295 const ash::DisplayInfo& display_info =
296 display_manager->GetDisplayInfo(display.id()); 296 display_manager->GetDisplayInfo(display.id());
297 base::DictionaryValue* js_display = new base::DictionaryValue(); 297 base::DictionaryValue* js_display = new base::DictionaryValue();
298 js_display->SetString("id", base::Int64ToString(display.id())); 298 js_display->SetString("id", base::Int64ToString(display.id()));
299 js_display->SetString("name", 299 js_display->SetString("name",
300 display_manager->GetDisplayNameForId(display.id())); 300 display_manager->GetDisplayNameForId(display.id()));
301 base::DictionaryValue* display_bounds = 301 base::DictionaryValue* display_bounds =
302 ConvertBoundsToValue(display.bounds()); 302 ConvertBoundsToValue(display.bounds());
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 bool enable = false; 498 bool enable = false;
499 if (!args->GetBoolean(0, &enable)) 499 if (!args->GetBoolean(0, &enable))
500 NOTREACHED(); 500 NOTREACHED();
501 501
502 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( 502 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays(
503 enable ? ash::DisplayManager::UNIFIED : ash::DisplayManager::EXTENDED); 503 enable ? ash::DisplayManager::UNIFIED : ash::DisplayManager::EXTENDED);
504 } 504 }
505 505
506 } // namespace options 506 } // namespace options
507 } // namespace chromeos 507 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698