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 <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 const gfx::Rect& bounds = display->bounds(); | 152 const gfx::Rect& bounds = display->bounds(); |
153 base::DictionaryValue* js_display = new base::DictionaryValue(); | 153 base::DictionaryValue* js_display = new base::DictionaryValue(); |
154 js_display->SetString("id", base::Int64ToString(display->id())); | 154 js_display->SetString("id", base::Int64ToString(display->id())); |
155 js_display->SetDouble("x", bounds.x()); | 155 js_display->SetDouble("x", bounds.x()); |
156 js_display->SetDouble("y", bounds.y()); | 156 js_display->SetDouble("y", bounds.y()); |
157 js_display->SetDouble("width", bounds.width()); | 157 js_display->SetDouble("width", bounds.width()); |
158 js_display->SetDouble("height", bounds.height()); | 158 js_display->SetDouble("height", bounds.height()); |
159 js_display->SetString("name", | 159 js_display->SetString("name", |
160 display_manager->GetDisplayNameFor(*display)); | 160 display_manager->GetDisplayNameFor(*display)); |
161 js_display->SetBoolean("isPrimary", display->id() == primary_id); | 161 js_display->SetBoolean("isPrimary", display->id() == primary_id); |
162 js_display->SetBoolean("isInternal", | 162 js_display->SetBoolean("isInternal", display->IsInternal()); |
163 display_manager->IsInternalDisplayId(display->id())); | |
164 display_info.Set(i, js_display); | 163 display_info.Set(i, js_display); |
165 } | 164 } |
166 | 165 |
167 scoped_ptr<base::Value> layout_value(base::Value::CreateNullValue()); | 166 scoped_ptr<base::Value> layout_value(base::Value::CreateNullValue()); |
168 scoped_ptr<base::Value> offset_value(base::Value::CreateNullValue()); | 167 scoped_ptr<base::Value> offset_value(base::Value::CreateNullValue()); |
169 if (display_manager->GetNumDisplays() > 1) { | 168 if (display_manager->GetNumDisplays() > 1) { |
170 const gfx::Display secondary_display = | 169 const gfx::Display secondary_display = |
171 ash::ScreenAsh::GetSecondaryDisplay(); | 170 ash::ScreenAsh::GetSecondaryDisplay(); |
172 const ash::DisplayLayout& layout = | 171 const ash::DisplayLayout& layout = |
173 display_controller->GetLayoutForDisplay(secondary_display); | 172 display_controller->GetLayoutForDisplay(secondary_display); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 ash::Shell::GetInstance()->output_configurator_animation()-> | 249 ash::Shell::GetInstance()->output_configurator_animation()-> |
251 StartFadeOutAnimation(base::Bind( | 250 StartFadeOutAnimation(base::Bind( |
252 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished, | 251 &DisplayOptionsHandler::OnFadeOutForDisplayLayoutFinished, |
253 base::Unretained(this), | 252 base::Unretained(this), |
254 static_cast<int>(layout), | 253 static_cast<int>(layout), |
255 static_cast<int>(offset))); | 254 static_cast<int>(offset))); |
256 } | 255 } |
257 | 256 |
258 } // namespace options | 257 } // namespace options |
259 } // namespace chromeos | 258 } // namespace chromeos |
OLD | NEW |