| 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 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
| 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // This class interacts directly with the underlying Xrandr API to manipulate | 41 // This class interacts directly with the underlying Xrandr API to manipulate |
| 42 // CTRCs and Outputs. It will likely grow more state, over time, or expose | 42 // CTRCs and Outputs. It will likely grow more state, over time, or expose |
| 43 // Output info in other ways as more of the Chrome display code grows up around | 43 // Output info in other ways as more of the Chrome display code grows up around |
| 44 // it. | 44 // it. |
| 45 class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { | 45 class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
| 46 public: | 46 public: |
| 47 class Observer { | 47 class Observer { |
| 48 public: | 48 public: |
| 49 // Called when the change of the display mode finished. It will usually | 49 // Called when the change of the display mode finished. It will usually |
| 50 // start the fading in the displays. | 50 // start the fading in the displays. |
| 51 virtual void OnDisplayModeChanged() = 0; | 51 virtual void OnDisplayModeChanged() {}; |
| 52 |
| 53 // Called when the change of the display mode is issued but failed. |
| 54 virtual void OnDisplayModeChangeFailed() {}; |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 OutputConfigurator(); | 57 OutputConfigurator(); |
| 55 virtual ~OutputConfigurator(); | 58 virtual ~OutputConfigurator(); |
| 56 | 59 |
| 57 int connected_output_count() const { return connected_output_count_; } | 60 int connected_output_count() const { return connected_output_count_; } |
| 58 | 61 |
| 59 OutputState output_state() const { return output_state_; } | 62 OutputState output_state() const { return output_state_; } |
| 60 | 63 |
| 61 // Called when the user hits ctrl-F4 to request a display mode change. | 64 // Called when the user hits ctrl-F4 to request a display mode change. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // The timer to delay sending the notification of OnDisplayChanged(). See also | 116 // The timer to delay sending the notification of OnDisplayChanged(). See also |
| 114 // the comments in Dispatch(). | 117 // the comments in Dispatch(). |
| 115 scoped_ptr<base::OneShotTimer<OutputConfigurator> > notification_timer_; | 118 scoped_ptr<base::OneShotTimer<OutputConfigurator> > notification_timer_; |
| 116 | 119 |
| 117 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); | 120 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace chromeos | 123 } // namespace chromeos |
| 121 | 124 |
| 122 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ | 125 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ |
| OLD | NEW |