| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <set> | 11 #include <set> |
| 11 | 12 |
| 12 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 13 #include "ash/shell_observer.h" | 14 #include "ash/shell_observer.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "chrome/browser/chromeos/settings/cros_settings.h" | 16 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 17 #include "ui/gfx/display.h" | 17 #include "ui/gfx/display.h" |
| 18 | 18 |
| 19 namespace policy { | 19 namespace policy { |
| 20 | 20 |
| 21 // Enforces the device policy DisplayRotationDefault. | 21 // Enforces the device policy DisplayRotationDefault. |
| 22 // This class is created in ChromeShellDelegate::PreInit() and registers | 22 // This class is created in ChromeShellDelegate::PreInit() and registers |
| 23 // itself with WindowTreeHostManager as Observer for display changes, and | 23 // itself with WindowTreeHostManager as Observer for display changes, and |
| 24 // with CrosSettings as Observer for setting changes. Whenever there is a change | 24 // with CrosSettings as Observer for setting changes. Whenever there is a change |
| 25 // in the display configuration, any new display with an id that is not already | 25 // in the display configuration, any new display with an id that is not already |
| (...skipping 27 matching lines...) Expand all Loading... |
| 53 // its value, and whether it has a value, in member variables | 53 // its value, and whether it has a value, in member variables |
| 54 // |display_rotation_default_| and |policy_enabled_|. Returns true if the | 54 // |display_rotation_default_| and |policy_enabled_|. Returns true if the |
| 55 // setting changed. | 55 // setting changed. |
| 56 bool UpdateFromCrosSettings(); | 56 bool UpdateFromCrosSettings(); |
| 57 | 57 |
| 58 bool policy_enabled_ = false; | 58 bool policy_enabled_ = false; |
| 59 gfx::Display::Rotation display_rotation_default_ = gfx::Display::ROTATE_0; | 59 gfx::Display::Rotation display_rotation_default_ = gfx::Display::ROTATE_0; |
| 60 std::set<int64_t> rotated_displays_; | 60 std::set<int64_t> rotated_displays_; |
| 61 bool rotation_in_progress_ = false; | 61 bool rotation_in_progress_ = false; |
| 62 | 62 |
| 63 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> settings_observer_; | 63 std::unique_ptr<chromeos::CrosSettings::ObserverSubscription> |
| 64 settings_observer_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(DisplayRotationDefaultHandler); | 66 DISALLOW_COPY_AND_ASSIGN(DisplayRotationDefaultHandler); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace policy | 69 } // namespace policy |
| 69 | 70 |
| 70 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DISPLAY_ROTATION_DEFAULT_HANDLER_H_ |
| OLD | NEW |