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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 else if (rotation_value == 180) | 531 else if (rotation_value == 180) |
532 new_rotation = display::Display::ROTATE_180; | 532 new_rotation = display::Display::ROTATE_180; |
533 else if (rotation_value == 270) | 533 else if (rotation_value == 270) |
534 new_rotation = display::Display::ROTATE_270; | 534 new_rotation = display::Display::ROTATE_270; |
535 else if (rotation_value != 0) | 535 else if (rotation_value != 0) |
536 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; | 536 LOG(ERROR) << "Invalid rotation: " << rotation_value << " Falls back to 0"; |
537 | 537 |
538 content::RecordAction( | 538 content::RecordAction( |
539 base::UserMetricsAction("Options_DisplaySetOrientation")); | 539 base::UserMetricsAction("Options_DisplaySetOrientation")); |
540 GetDisplayConfigurationController()->SetDisplayRotation( | 540 GetDisplayConfigurationController()->SetDisplayRotation( |
541 display_id, new_rotation, display::Display::ROTATION_SOURCE_USER, | 541 display_id, new_rotation, display::Display::ROTATION_SOURCE_USER); |
542 true /* user_action */); | |
543 } | 542 } |
544 | 543 |
545 void DisplayOptionsHandler::HandleSetColorProfile(const base::ListValue* args) { | 544 void DisplayOptionsHandler::HandleSetColorProfile(const base::ListValue* args) { |
546 DCHECK(!args->empty()); | 545 DCHECK(!args->empty()); |
547 int64_t display_id = GetDisplayIdFromArgs(args); | 546 int64_t display_id = GetDisplayIdFromArgs(args); |
548 if (display_id == display::kInvalidDisplayId) | 547 if (display_id == display::kInvalidDisplayId) |
549 return; | 548 return; |
550 | 549 |
551 std::string profile_value; | 550 std::string profile_value; |
552 if (!args->GetString(1, &profile_value)) { | 551 if (!args->GetString(1, &profile_value)) { |
(...skipping 28 matching lines...) Expand all Loading... |
581 if (!args->GetBoolean(0, &enable)) | 580 if (!args->GetBoolean(0, &enable)) |
582 NOTREACHED(); | 581 NOTREACHED(); |
583 | 582 |
584 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( | 583 GetDisplayManager()->SetDefaultMultiDisplayModeForCurrentDisplays( |
585 enable ? display::DisplayManager::UNIFIED | 584 enable ? display::DisplayManager::UNIFIED |
586 : display::DisplayManager::EXTENDED); | 585 : display::DisplayManager::EXTENDED); |
587 } | 586 } |
588 | 587 |
589 } // namespace options | 588 } // namespace options |
590 } // namespace chromeos | 589 } // namespace chromeos |
OLD | NEW |