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/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/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void DisplayOptionsHandler::SendDisplayInfo() { | 97 void DisplayOptionsHandler::SendDisplayInfo() { |
98 aura::DisplayManager* display_manager = | 98 aura::DisplayManager* display_manager = |
99 aura::Env::GetInstance()->display_manager(); | 99 aura::Env::GetInstance()->display_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 < display_manager->GetNumDisplays(); ++i) { | 106 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { |
107 const gfx::Display& display = display_manager->GetDisplayAt(i); | 107 const gfx::Display* display = display_manager->GetDisplayAt(i); |
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 DisplayController* display_controller = | 118 DisplayController* display_controller = |
119 ash::Shell::GetInstance()->display_controller(); | 119 ash::Shell::GetInstance()->display_controller(); |
120 base::FundamentalValue layout(static_cast<int>( | 120 base::FundamentalValue layout(static_cast<int>( |
(...skipping 30 matching lines...) Expand all Loading... |
151 DCHECK_LE(DisplayController::TOP, layout); | 151 DCHECK_LE(DisplayController::TOP, layout); |
152 DCHECK_GE(DisplayController::LEFT, layout); | 152 DCHECK_GE(DisplayController::LEFT, layout); |
153 | 153 |
154 ash::Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( | 154 ash::Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( |
155 static_cast<DisplayController::SecondaryDisplayLayout>(layout)); | 155 static_cast<DisplayController::SecondaryDisplayLayout>(layout)); |
156 SendDisplayInfo(); | 156 SendDisplayInfo(); |
157 } | 157 } |
158 | 158 |
159 } // namespace options2 | 159 } // namespace options2 |
160 } // namespace chromeos | 160 } // namespace chromeos |
OLD | NEW |