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_MULTI_DISPLAY_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ |
6 #define ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void AddDisplayFromSpec(const std::string& spec); | 127 void AddDisplayFromSpec(const std::string& spec); |
128 | 128 |
129 // Set the 1st display as an internal display and returns the display Id for | 129 // Set the 1st display as an internal display and returns the display Id for |
130 // the internal display. | 130 // the internal display. |
131 int64 SetFirstDisplayAsInternalDisplayForTest(); | 131 int64 SetFirstDisplayAsInternalDisplayForTest(); |
132 | 132 |
133 // Checks if the mouse pointer is on one of displays, and moves to | 133 // Checks if the mouse pointer is on one of displays, and moves to |
134 // the center of the nearest display if it's outside of all displays. | 134 // the center of the nearest display if it's outside of all displays. |
135 void EnsurePointerInDisplays(); | 135 void EnsurePointerInDisplays(); |
136 | 136 |
| 137 // Updates |display_names_| by calling platform-dependent functions. |
| 138 void RefreshDisplayNames(); |
| 139 |
137 // Update the display's id in the |display_list| to match the ones | 140 // Update the display's id in the |display_list| to match the ones |
138 // stored in this display manager's |displays_|. This is used to | 141 // stored in this display manager's |displays_|. This is used to |
139 // emulate display change behavior during the test byn creating the | 142 // emulate display change behavior during the test byn creating the |
140 // display list with the same display ids but with different bounds | 143 // display list with the same display ids but with different bounds |
141 void SetDisplayIdsForTest(DisplayList* display_list) const; | 144 void SetDisplayIdsForTest(DisplayList* display_list) const; |
142 | 145 |
143 DisplayList displays_; | 146 DisplayList displays_; |
144 | 147 |
145 int64 internal_display_id_; | 148 int64 internal_display_id_; |
146 | 149 |
147 // An internal display cache used when the internal display is disconnectd. | 150 // An internal display cache used when the internal display is disconnectd. |
148 scoped_ptr<gfx::Display> internal_display_; | 151 scoped_ptr<gfx::Display> internal_display_; |
149 | 152 |
150 bool force_bounds_changed_; | 153 bool force_bounds_changed_; |
151 | 154 |
152 // The mapping from the display ID to its overscan insets. | 155 // The mapping from the display ID to its overscan insets. |
153 std::map<int64, gfx::Insets> overscan_mapping_; | 156 std::map<int64, gfx::Insets> overscan_mapping_; |
154 | 157 |
| 158 // The cached display's name for the display ID. |
| 159 std::map<int64, std::string> display_names_; |
| 160 |
155 DISALLOW_COPY_AND_ASSIGN(MultiDisplayManager); | 161 DISALLOW_COPY_AND_ASSIGN(MultiDisplayManager); |
156 }; | 162 }; |
157 | 163 |
158 extern const aura::WindowProperty<int64>* const kDisplayIdKey; | 164 extern const aura::WindowProperty<int64>* const kDisplayIdKey; |
159 | 165 |
160 } // namespace internal | 166 } // namespace internal |
161 } // namespace ash | 167 } // namespace ash |
162 | 168 |
163 #endif // ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ | 169 #endif // ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ |
OLD | NEW |