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_configurator_animation.h" | 9 #include "ash/display/display_configurator_animation.h" |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
11 #include "ash/display/display_manager.h" | 11 #include "ash/display/display_manager.h" |
12 #include "ash/display/resolution_notification_controller.h" | 12 #include "ash/display/resolution_notification_controller.h" |
| 13 #include "ash/rotator/screen_rotation_animator.h" |
13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
14 #include "base/bind.h" | 15 #include "base/bind.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
18 #include "base/values.h" | 19 #include "base/values.h" |
19 #include "chrome/browser/chromeos/display/display_preferences.h" | 20 #include "chrome/browser/chromeos/display/display_preferences.h" |
20 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
21 #include "content/public/browser/user_metrics.h" | 22 #include "content/public/browser/user_metrics.h" |
22 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 new_rotation = gfx::Display::ROTATE_90; | 425 new_rotation = gfx::Display::ROTATE_90; |
425 else if (rotation_value == "180") | 426 else if (rotation_value == "180") |
426 new_rotation = gfx::Display::ROTATE_180; | 427 new_rotation = gfx::Display::ROTATE_180; |
427 else if (rotation_value == "270") | 428 else if (rotation_value == "270") |
428 new_rotation = gfx::Display::ROTATE_270; | 429 new_rotation = gfx::Display::ROTATE_270; |
429 else if (rotation_value != "0") | 430 else if (rotation_value != "0") |
430 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; | 431 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; |
431 | 432 |
432 content::RecordAction( | 433 content::RecordAction( |
433 base::UserMetricsAction("Options_DisplaySetOrientation")); | 434 base::UserMetricsAction("Options_DisplaySetOrientation")); |
434 GetDisplayManager()->SetDisplayRotation(display_id, new_rotation); | 435 ash::ScreenRotationAnimator(display_id).Rotate(new_rotation); |
435 } | 436 } |
436 | 437 |
437 void DisplayOptionsHandler::HandleSetColorProfile(const base::ListValue* args) { | 438 void DisplayOptionsHandler::HandleSetColorProfile(const base::ListValue* args) { |
438 DCHECK(!args->empty()); | 439 DCHECK(!args->empty()); |
439 int64 display_id = GetDisplayId(args); | 440 int64 display_id = GetDisplayId(args); |
440 if (display_id == gfx::Display::kInvalidDisplayID) | 441 if (display_id == gfx::Display::kInvalidDisplayID) |
441 return; | 442 return; |
442 | 443 |
443 std::string profile_value; | 444 std::string profile_value; |
444 if (!args->GetString(1, &profile_value)) { | 445 if (!args->GetString(1, &profile_value)) { |
(...skipping 13 matching lines...) Expand all Loading... |
458 return; | 459 return; |
459 } | 460 } |
460 | 461 |
461 GetDisplayManager()->SetColorCalibrationProfile( | 462 GetDisplayManager()->SetColorCalibrationProfile( |
462 display_id, static_cast<ui::ColorCalibrationProfile>(profile_id)); | 463 display_id, static_cast<ui::ColorCalibrationProfile>(profile_id)); |
463 SendAllDisplayInfo(); | 464 SendAllDisplayInfo(); |
464 } | 465 } |
465 | 466 |
466 } // namespace options | 467 } // namespace options |
467 } // namespace chromeos | 468 } // namespace chromeos |
OLD | NEW |