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

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

Issue 10696002: ASH: Use virtual screen coordinates in Display::bounds() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | Annotate | Revision Log
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/options2/chromeos/display_options_handler.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/display_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/monitor/monitor_controller.h" 9 #include "ash/monitor/monitor_controller.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void DisplayOptionsHandler::SendDisplayInfo() { 97 void DisplayOptionsHandler::SendDisplayInfo() {
98 aura::MonitorManager* monitor_manager = 98 aura::MonitorManager* monitor_manager =
99 aura::Env::GetInstance()->monitor_manager(); 99 aura::Env::GetInstance()->monitor_manager();
100 chromeos::OutputConfigurator* output_configurator = 100 chromeos::OutputConfigurator* output_configurator =
101 ash::Shell::GetInstance()->output_configurator(); 101 ash::Shell::GetInstance()->output_configurator();
102 base::FundamentalValue mirroring( 102 base::FundamentalValue mirroring(
103 output_configurator->output_state() == chromeos::STATE_DUAL_MIRROR); 103 output_configurator->output_state() == chromeos::STATE_DUAL_MIRROR);
104 104
105 base::ListValue displays; 105 base::ListValue displays;
106 for (size_t i = 0; i < monitor_manager->GetNumDisplays(); ++i) { 106 for (size_t i = 0; i < monitor_manager->GetNumDisplays(); ++i) {
107 const gfx::Display& display = monitor_manager->GetDisplayAt(i); 107 const gfx::Display* display = monitor_manager->GetDisplayAt(i);
Ben Goodger (Google) 2012/06/27 15:32:52 i get confused by the various ways you return disp
oshima 2012/06/27 21:00:06 crbug.com/122863 I'm planning to consolidate gfx:
108 const gfx::Rect& bounds = display.bounds(); 108 const gfx::Rect& bounds = display->bounds();
109 base::DictionaryValue* js_display = new base::DictionaryValue(); 109 base::DictionaryValue* js_display = new base::DictionaryValue();
110 js_display->SetDouble("id", display.id()); 110 js_display->SetDouble("id", display->id());
111 js_display->SetDouble("x", bounds.x()); 111 js_display->SetDouble("x", bounds.x());
112 js_display->SetDouble("y", bounds.y()); 112 js_display->SetDouble("y", bounds.y());
113 js_display->SetDouble("width", bounds.width()); 113 js_display->SetDouble("width", bounds.width());
114 js_display->SetDouble("height", bounds.height()); 114 js_display->SetDouble("height", bounds.height());
115 displays.Set(i, js_display); 115 displays.Set(i, js_display);
116 } 116 }
117 117
118 MonitorController* monitor_controller = 118 MonitorController* monitor_controller =
119 ash::Shell::GetInstance()->monitor_controller(); 119 ash::Shell::GetInstance()->monitor_controller();
120 base::FundamentalValue layout(static_cast<int>( 120 base::FundamentalValue layout(static_cast<int>(
(...skipping 30 matching lines...) Expand all
151 DCHECK_LE(MonitorController::TOP, layout); 151 DCHECK_LE(MonitorController::TOP, layout);
152 DCHECK_GE(MonitorController::LEFT, layout); 152 DCHECK_GE(MonitorController::LEFT, layout);
153 153
154 ash::Shell::GetInstance()->monitor_controller()->SetSecondaryDisplayLayout( 154 ash::Shell::GetInstance()->monitor_controller()->SetSecondaryDisplayLayout(
155 static_cast<MonitorController::SecondaryDisplayLayout>(layout)); 155 static_cast<MonitorController::SecondaryDisplayLayout>(layout));
156 SendDisplayInfo(); 156 SendDisplayInfo();
157 } 157 }
158 158
159 } // namespace options2 159 } // namespace options2
160 } // namespace chromeos 160 } // namespace chromeos
OLDNEW
« ash/ash.gyp ('K') | « ash/shell.cc ('k') | ui/aura/monitor_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698