| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (display_info.rotation() == gfx::Display::ROTATE_90 || | 196 if (display_info.rotation() == gfx::Display::ROTATE_90 || |
| 197 display_info.rotation() == gfx::Display::ROTATE_270) { | 197 display_info.rotation() == gfx::Display::ROTATE_270) { |
| 198 float tmp = base_size.width(); | 198 float tmp = base_size.width(); |
| 199 base_size.set_width(base_size.height()); | 199 base_size.set_width(base_size.height()); |
| 200 base_size.set_height(tmp); | 200 base_size.set_height(tmp); |
| 201 } | 201 } |
| 202 for (size_t i = 0; i < ui_scales.size(); ++i) { | 202 for (size_t i = 0; i < ui_scales.size(); ++i) { |
| 203 gfx::SizeF new_size = base_size; | 203 gfx::SizeF new_size = base_size; |
| 204 new_size.Scale(ui_scales[i]); | 204 new_size.Scale(ui_scales[i]); |
| 205 resolutions.push_back(ash::internal::Resolution( | 205 resolutions.push_back(ash::internal::Resolution( |
| 206 gfx::ToFlooredSize(new_size), false /* interlaced */)); | 206 gfx::ToFlooredSize(new_size), -1.0f, false /* interlaced */)); |
| 207 } | 207 } |
| 208 } else { | 208 } else { |
| 209 for (size_t i = 0; i < display_info.resolutions().size(); ++i) | 209 for (size_t i = 0; i < display_info.resolutions().size(); ++i) |
| 210 resolutions.push_back(display_info.resolutions()[i]); | 210 resolutions.push_back(display_info.resolutions()[i]); |
| 211 } | 211 } |
| 212 std::sort(resolutions.begin(), resolutions.end(), CompareResolution); | 212 std::sort(resolutions.begin(), resolutions.end(), CompareResolution); |
| 213 | 213 |
| 214 base::ListValue* js_resolutions = new base::ListValue(); | 214 base::ListValue* js_resolutions = new base::ListValue(); |
| 215 gfx::Size current_size = display_info.bounds_in_native().size(); | 215 gfx::Size current_size = display_info.bounds_in_native().size(); |
| 216 gfx::Insets current_overscan = display_info.GetOverscanInsetsInPixel(); | 216 gfx::Insets current_overscan = display_info.GetOverscanInsetsInPixel(); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 else if (rotation_value == "270") | 396 else if (rotation_value == "270") |
| 397 new_rotation = gfx::Display::ROTATE_270; | 397 new_rotation = gfx::Display::ROTATE_270; |
| 398 else if (rotation_value != "0") | 398 else if (rotation_value != "0") |
| 399 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; | 399 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; |
| 400 | 400 |
| 401 GetDisplayManager()->SetDisplayRotation(display_id, new_rotation); | 401 GetDisplayManager()->SetDisplayRotation(display_id, new_rotation); |
| 402 } | 402 } |
| 403 | 403 |
| 404 } // namespace options | 404 } // namespace options |
| 405 } // namespace chromeos | 405 } // namespace chromeos |
| OLD | NEW |