| OLD | NEW | 
|    1 // Copyright 2014 The Chromium Authors. All rights reserved. |    1 // Copyright 2014 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 UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |    5 #ifndef UI_DISPLAY_MANAGER_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 
|    6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |    6 #define UI_DISPLAY_MANAGER_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 
|    7  |    7  | 
|    8 #include <stdint.h> |    8 #include <stdint.h> | 
|    9  |    9  | 
|   10 #include <map> |   10 #include <map> | 
|   11 #include <memory> |   11 #include <memory> | 
|   12 #include <queue> |   12 #include <queue> | 
|   13 #include <string> |   13 #include <string> | 
|   14 #include <vector> |   14 #include <vector> | 
|   15  |   15  | 
|   16 #include "base/event_types.h" |   16 #include "base/event_types.h" | 
|   17 #include "base/macros.h" |   17 #include "base/macros.h" | 
|   18 #include "base/memory/scoped_vector.h" |   18 #include "base/memory/scoped_vector.h" | 
|   19 #include "base/memory/weak_ptr.h" |   19 #include "base/memory/weak_ptr.h" | 
|   20 #include "base/observer_list.h" |   20 #include "base/observer_list.h" | 
|   21 #include "base/timer/timer.h" |   21 #include "base/timer/timer.h" | 
|   22 #include "third_party/cros_system_api/dbus/service_constants.h" |   22 #include "third_party/cros_system_api/dbus/service_constants.h" | 
|   23 #include "ui/display/chromeos/display_snapshot_virtual.h" |   23 #include "ui/display/manager/chromeos/display_snapshot_virtual.h" | 
|   24 #include "ui/display/chromeos/query_content_protection_task.h" |   24 #include "ui/display/manager/chromeos/query_content_protection_task.h" | 
|   25 #include "ui/display/display_export.h" |   25 #include "ui/display/manager/display_manager_export.h" | 
|   26 #include "ui/display/types/display_constants.h" |   26 #include "ui/display/types/display_constants.h" | 
|   27 #include "ui/display/types/native_display_observer.h" |   27 #include "ui/display/types/native_display_observer.h" | 
|   28 #include "ui/display/util/display_util.h" |   28 #include "ui/display/util/display_util.h" | 
|   29 #include "ui/gfx/geometry/size.h" |   29 #include "ui/gfx/geometry/size.h" | 
|   30  |   30  | 
|   31 namespace gfx { |   31 namespace gfx { | 
|   32 class Size; |   32 class Size; | 
|   33 } |   33 } | 
|   34  |   34  | 
|   35 namespace ui { |   35 namespace ui { | 
|   36 struct GammaRampRGBEntry; |   36 struct GammaRampRGBEntry; | 
|   37 class DisplayLayoutManager; |   37 class DisplayLayoutManager; | 
|   38 class DisplayMode; |   38 class DisplayMode; | 
|   39 class DisplaySnapshot; |   39 class DisplaySnapshot; | 
|   40 class NativeDisplayDelegate; |   40 class NativeDisplayDelegate; | 
|   41 class UpdateDisplayConfigurationTask; |   41 class UpdateDisplayConfigurationTask; | 
|   42  |   42  | 
|   43 // This class interacts directly with the system display configurator. |   43 // This class interacts directly with the system display configurator. | 
|   44 class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver { |   44 class DISPLAY_MANAGER_EXPORT DisplayConfigurator | 
 |   45     : public NativeDisplayObserver { | 
|   45  public: |   46  public: | 
|   46   typedef uint64_t ContentProtectionClientId; |   47   typedef uint64_t ContentProtectionClientId; | 
|   47   static const ContentProtectionClientId kInvalidClientId = 0; |   48   static const ContentProtectionClientId kInvalidClientId = 0; | 
|   48  |   49  | 
|   49   typedef base::Callback<void(bool /* success */)> ConfigurationCallback; |   50   typedef base::Callback<void(bool /* success */)> ConfigurationCallback; | 
|   50  |   51  | 
|   51   typedef base::Callback<void(bool /* success */)> EnableProtectionCallback; |   52   typedef base::Callback<void(bool /* success */)> EnableProtectionCallback; | 
|   52  |   53  | 
|   53   struct QueryProtectionResponse { |   54   struct QueryProtectionResponse { | 
|   54     // True if the query succeeded, false otherwise. |   55     // True if the query succeeded, false otherwise. | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|   74   typedef std::map<int64_t, uint32_t> ContentProtections; |   75   typedef std::map<int64_t, uint32_t> ContentProtections; | 
|   75  |   76  | 
|   76   class Observer { |   77   class Observer { | 
|   77    public: |   78    public: | 
|   78     virtual ~Observer() {} |   79     virtual ~Observer() {} | 
|   79  |   80  | 
|   80     // Called after the display mode has been changed. |display| contains the |   81     // Called after the display mode has been changed. |display| contains the | 
|   81     // just-applied configuration. Note that the X server is no longer grabbed |   82     // just-applied configuration. Note that the X server is no longer grabbed | 
|   82     // when this method is called, so the actual configuration could've changed |   83     // when this method is called, so the actual configuration could've changed | 
|   83     // already. |   84     // already. | 
|   84     virtual void OnDisplayModeChanged( |   85     virtual void OnDisplayModeChanged(const DisplayStateList& displays) {} | 
|   85         const DisplayStateList& displays) {} |  | 
|   86  |   86  | 
|   87     // Called after a display mode change attempt failed. |displays| contains |   87     // Called after a display mode change attempt failed. |displays| contains | 
|   88     // displays that are detected when failed. |   88     // displays that are detected when failed. | 
|   89     // |failed_new_state| is the new state which the system failed to enter. |   89     // |failed_new_state| is the new state which the system failed to enter. | 
|   90     virtual void OnDisplayModeChangeFailed( |   90     virtual void OnDisplayModeChangeFailed( | 
|   91         const DisplayStateList& displays, |   91         const DisplayStateList& displays, | 
|   92         MultipleDisplayState failed_new_state) {} |   92         MultipleDisplayState failed_new_state) {} | 
|   93  |   93  | 
|   94     // Called after the power state has been changed. |power_state| contains |   94     // Called after the power state has been changed. |power_state| contains | 
|   95     // the just-applied power state. |   95     // the just-applied power state. | 
|   96     virtual void OnPowerStateChanged( |   96     virtual void OnPowerStateChanged(chromeos::DisplayPowerState power_state) {} | 
|   97         chromeos::DisplayPowerState power_state) {} |  | 
|   98   }; |   97   }; | 
|   99  |   98  | 
|  100   // Interface for classes that make decisions about which display state |   99   // Interface for classes that make decisions about which display state | 
|  101   // should be used. |  100   // should be used. | 
|  102   class StateController { |  101   class StateController { | 
|  103    public: |  102    public: | 
|  104     virtual ~StateController() {} |  103     virtual ~StateController() {} | 
|  105  |  104  | 
|  106     // Called when displays are detected. |  105     // Called when displays are detected. | 
|  107     virtual MultipleDisplayState GetStateForDisplayIds( |  106     virtual MultipleDisplayState GetStateForDisplayIds( | 
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  483   std::unique_ptr<UpdateDisplayConfigurationTask> configuration_task_; |  482   std::unique_ptr<UpdateDisplayConfigurationTask> configuration_task_; | 
|  484  |  483  | 
|  485   // This must be the last variable. |  484   // This must be the last variable. | 
|  486   base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |  485   base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 
|  487  |  486  | 
|  488   DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |  487   DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 
|  489 }; |  488 }; | 
|  490  |  489  | 
|  491 }  // namespace ui |  490 }  // namespace ui | 
|  492  |  491  | 
|  493 #endif  // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |  492 #endif  // UI_DISPLAY_MANAGER_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 
| OLD | NEW |