Chromium Code Reviews| 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 ASH_DISPLAY_DISPLAY_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 struct DisplayInfo { | 134 struct DisplayInfo { |
| 135 // The cached name of the display. | 135 // The cached name of the display. |
| 136 std::string name; | 136 std::string name; |
| 137 | 137 |
| 138 // The original bounds_in_pixel for the display. This can be different from | 138 // The original bounds_in_pixel for the display. This can be different from |
| 139 // the current one in case of overscan insets. | 139 // the current one in case of overscan insets. |
| 140 gfx::Rect original_bounds_in_pixel; | 140 gfx::Rect original_bounds_in_pixel; |
| 141 | 141 |
| 142 // The overscan insets for the display. | 142 // The overscan insets for the display. |
| 143 gfx::Insets overscan_insets_in_dip; | 143 gfx::Insets overscan_insets_in_dip; |
| 144 | |
| 145 // True if the output overscans. False means unknown, it may or may not | |
| 146 // overscan. | |
|
oshima
2013/01/12 02:06:38
True if we detect that the display has overscan ar
Jun Mukai
2013/01/14 18:18:51
Done.
| |
| 147 bool overscan; | |
|
oshima
2013/01/12 02:06:38
has_overscan ?
(according to http://en.wikipedia.
Jun Mukai
2013/01/14 18:18:51
done.
# sometimes 'overscan' is used as verb, whic
| |
| 148 | |
| 149 // True if the |overscan_insets_in_dip| is specified. This is set because | |
| 150 // the user may specify an empty intentionally. | |
| 151 bool overscan_insets_specified; | |
|
oshima
2013/01/12 02:06:38
custom_overscan_insets ?
Jun Mukai
2013/01/14 18:18:51
done. has_custom_overscan_insets for consistency.
| |
| 152 | |
| 153 DisplayInfo(); | |
|
oshima
2013/01/12 02:06:38
move this to top
Jun Mukai
2013/01/14 18:18:51
Done.
| |
| 144 }; | 154 }; |
| 145 | 155 |
| 146 void Init(); | 156 void Init(); |
| 147 void CycleDisplayImpl(); | 157 void CycleDisplayImpl(); |
| 148 void ScaleDisplayImpl(); | 158 void ScaleDisplayImpl(); |
| 149 | 159 |
| 150 gfx::Display& FindDisplayForRootWindow(const aura::RootWindow* root); | 160 gfx::Display& FindDisplayForRootWindow(const aura::RootWindow* root); |
| 151 gfx::Display& FindDisplayForId(int64 id); | 161 gfx::Display& FindDisplayForId(int64 id); |
| 152 | 162 |
| 153 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for | 163 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for |
| 154 // the format of |spec|. | 164 // the format of |spec|. |
| 155 void AddDisplayFromSpec(const std::string& spec); | 165 void AddDisplayFromSpec(const std::string& spec); |
| 156 | 166 |
| 157 // Set the 1st display as an internal display and returns the display Id for | 167 // Set the 1st display as an internal display and returns the display Id for |
| 158 // the internal display. | 168 // the internal display. |
| 159 int64 SetFirstDisplayAsInternalDisplayForTest(); | 169 int64 SetFirstDisplayAsInternalDisplayForTest(); |
| 160 | 170 |
| 161 // Checks if the mouse pointer is on one of displays, and moves to | 171 // Checks if the mouse pointer is on one of displays, and moves to |
| 162 // the center of the nearest display if it's outside of all displays. | 172 // the center of the nearest display if it's outside of all displays. |
| 163 void EnsurePointerInDisplays(); | 173 void EnsurePointerInDisplays(); |
| 164 | 174 |
| 165 // Updates |display_names_| by calling platform-dependent functions. | 175 // Updates |display_info_| by calling platform-dependent functions. |
| 166 void RefreshDisplayNames(); | 176 void RefreshDisplayInfo(); |
| 167 | 177 |
| 168 // Update the display's id in the |display_list| to match the ones | 178 // Update the display's id in the |display_list| to match the ones |
| 169 // stored in this display manager's |displays_|. This is used to | 179 // stored in this display manager's |displays_|. This is used to |
| 170 // emulate display change behavior during the test byn creating the | 180 // emulate display change behavior during the test byn creating the |
| 171 // display list with the same display ids but with different bounds | 181 // display list with the same display ids but with different bounds |
| 172 void SetDisplayIdsForTest(DisplayList* display_list) const; | 182 void SetDisplayIdsForTest(DisplayList* display_list) const; |
| 173 | 183 |
| 174 DisplayList displays_; | 184 DisplayList displays_; |
| 175 | 185 |
| 176 int64 internal_display_id_; | 186 int64 internal_display_id_; |
| 177 | 187 |
| 178 // An internal display cache used when the internal display is disconnectd. | 188 // An internal display cache used when the internal display is disconnectd. |
| 179 scoped_ptr<gfx::Display> internal_display_; | 189 scoped_ptr<gfx::Display> internal_display_; |
| 180 | 190 |
| 181 bool force_bounds_changed_; | 191 bool force_bounds_changed_; |
| 182 | 192 |
| 183 // The mapping from the display ID to its internal data. | 193 // The mapping from the display ID to its internal data. |
| 184 std::map<int64, DisplayInfo> display_info_; | 194 std::map<int64, DisplayInfo> display_info_; |
| 185 | 195 |
| 186 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 196 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 187 }; | 197 }; |
| 188 | 198 |
| 189 extern const aura::WindowProperty<int64>* const kDisplayIdKey; | 199 extern const aura::WindowProperty<int64>* const kDisplayIdKey; |
| 190 | 200 |
| 191 } // namespace internal | 201 } // namespace internal |
| 192 } // namespace ash | 202 } // namespace ash |
| 193 | 203 |
| 194 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 204 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
| OLD | NEW |