Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ash/display/display_manager.h

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 // True if the given |display| is currently connected. 54 // True if the given |display| is currently connected.
55 bool IsActiveDisplay(const gfx::Display& display) const; 55 bool IsActiveDisplay(const gfx::Display& display) const;
56 56
57 // True if there is an internal display. 57 // True if there is an internal display.
58 bool HasInternalDisplay() const; 58 bool HasInternalDisplay() const;
59 59
60 bool IsInternalDisplayId(int64 id) const; 60 bool IsInternalDisplayId(int64 id) const;
61 61
62 uint64 internal_display_id() const { return internal_display_id_; }
63
64 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window, 62 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window,
65 const gfx::Insets& insets); 63 const gfx::Insets& insets);
66 64
67 // Returns display for given |id|; 65 // Returns display for given |id|;
68 const gfx::Display& GetDisplayForId(int64 id) const; 66 const gfx::Display& GetDisplayForId(int64 id) const;
69 67
70 // Finds the display that contains |point| in screeen coordinates. 68 // Finds the display that contains |point| in screeen coordinates.
71 // Returns invalid display if there is no display that can satisfy 69 // Returns invalid display if there is no display that can satisfy
72 // the condition. 70 // the condition.
73 const gfx::Display& FindDisplayContainingPoint( 71 const gfx::Display& FindDisplayContainingPoint(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 gfx::Display& FindDisplayForId(int64 id); 162 gfx::Display& FindDisplayForId(int64 id);
165 163
166 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for 164 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for
167 // the format of |spec|. 165 // the format of |spec|.
168 void AddDisplayFromSpec(const std::string& spec); 166 void AddDisplayFromSpec(const std::string& spec);
169 167
170 // Set the 1st display as an internal display and returns the display Id for 168 // Set the 1st display as an internal display and returns the display Id for
171 // the internal display. 169 // the internal display.
172 int64 SetFirstDisplayAsInternalDisplayForTest(); 170 int64 SetFirstDisplayAsInternalDisplayForTest();
173 171
172 // Reset the internal display id after test finishes.
173 void ResetInternalDisplayForTest();
oshima 2013/02/12 17:38:51 If you want to keep this, then please move this to
ynovikov 2013/02/12 21:17:47 Done.
174
174 // Checks if the mouse pointer is on one of displays, and moves to 175 // Checks if the mouse pointer is on one of displays, and moves to
175 // the center of the nearest display if it's outside of all displays. 176 // the center of the nearest display if it's outside of all displays.
176 void EnsurePointerInDisplays(); 177 void EnsurePointerInDisplays();
177 178
178 // Updates |display_info_| by calling platform-dependent functions. 179 // Updates |display_info_| by calling platform-dependent functions.
179 void RefreshDisplayInfo(); 180 void RefreshDisplayInfo();
180 181
181 // Update the display's id in the |display_list| to match the ones 182 // Update the display's id in the |display_list| to match the ones
182 // stored in this display manager's |displays_|. This is used to 183 // stored in this display manager's |displays_|. This is used to
183 // emulate display change behavior during the test byn creating the 184 // emulate display change behavior during the test byn creating the
184 // display list with the same display ids but with different bounds 185 // display list with the same display ids but with different bounds
185 void SetDisplayIdsForTest(DisplayList* display_list) const; 186 void SetDisplayIdsForTest(DisplayList* display_list) const;
186 187
187 // Forcibly specify 'has_overscan' flag of the DisplayInfo for specified |id|. 188 // Forcibly specify 'has_overscan' flag of the DisplayInfo for specified |id|.
188 void SetHasOverscanFlagForTest(int64 id, bool has_overscan); 189 void SetHasOverscanFlagForTest(int64 id, bool has_overscan);
189 190
190 DisplayList displays_; 191 DisplayList displays_;
191 192
192 int64 internal_display_id_;
193
194 // An internal display cache used when the internal display is disconnectd. 193 // An internal display cache used when the internal display is disconnectd.
195 scoped_ptr<gfx::Display> internal_display_; 194 scoped_ptr<gfx::Display> internal_display_;
196 195
197 bool force_bounds_changed_; 196 bool force_bounds_changed_;
198 197
199 // The mapping from the display ID to its internal data. 198 // The mapping from the display ID to its internal data.
200 std::map<int64, DisplayInfo> display_info_; 199 std::map<int64, DisplayInfo> display_info_;
201 200
202 DISALLOW_COPY_AND_ASSIGN(DisplayManager); 201 DISALLOW_COPY_AND_ASSIGN(DisplayManager);
203 }; 202 };
204 203
205 extern const aura::WindowProperty<int64>* const kDisplayIdKey; 204 extern const aura::WindowProperty<int64>* const kDisplayIdKey;
206 205
207 } // namespace internal 206 } // namespace internal
208 } // namespace ash 207 } // namespace ash
209 208
210 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ 209 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698