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

Side by Side Diff: ui/display/screen.h

Issue 2721203007: gfx::NativeView <-> NativeWindow in dislpay.h (Closed)
Patch Set: scope Created 3 years, 9 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
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/display/screen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 UI_DISPLAY_SCREEN_H_ 5 #ifndef UI_DISPLAY_SCREEN_H_
6 #define UI_DISPLAY_SCREEN_H_ 6 #define UI_DISPLAY_SCREEN_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Mirrored displays are excluded; this method is intended to return the 51 // Mirrored displays are excluded; this method is intended to return the
52 // number of distinct, usable displays. 52 // number of distinct, usable displays.
53 virtual int GetNumDisplays() const = 0; 53 virtual int GetNumDisplays() const = 0;
54 54
55 // Returns the list of displays that are currently available. 55 // Returns the list of displays that are currently available.
56 virtual const std::vector<Display>& GetAllDisplays() const = 0; 56 virtual const std::vector<Display>& GetAllDisplays() const = 0;
57 57
58 // Returns the display nearest the specified window. 58 // Returns the display nearest the specified window.
59 // If the window is NULL or the window is not rooted to a display this will 59 // If the window is NULL or the window is not rooted to a display this will
60 // return the primary display. 60 // return the primary display.
61 virtual Display GetDisplayNearestWindow(gfx::NativeView view) const = 0; 61 virtual Display GetDisplayNearestWindow(gfx::NativeWindow view) const = 0;
62 virtual Display GetDisplayNearestView(gfx::NativeView view) const;
62 63
63 // Returns the display nearest the specified point. |point| should be in DIPs. 64 // Returns the display nearest the specified point. |point| should be in DIPs.
64 virtual Display GetDisplayNearestPoint(const gfx::Point& point) const = 0; 65 virtual Display GetDisplayNearestPoint(const gfx::Point& point) const = 0;
65 66
66 // Returns the display that most closely intersects the provided bounds. 67 // Returns the display that most closely intersects the provided bounds.
67 virtual Display GetDisplayMatching(const gfx::Rect& match_rect) const = 0; 68 virtual Display GetDisplayMatching(const gfx::Rect& match_rect) const = 0;
68 69
69 // Returns the primary display. 70 // Returns the primary display.
70 virtual Display GetPrimaryDisplay() const = 0; 71 virtual Display GetPrimaryDisplay() const = 0;
71 72
(...skipping 12 matching lines...) Expand all
84 // If |view| is null, the primary display is used as the context. 85 // If |view| is null, the primary display is used as the context.
85 virtual gfx::Rect DIPToScreenRectInWindow(gfx::NativeView view, 86 virtual gfx::Rect DIPToScreenRectInWindow(gfx::NativeView view,
86 const gfx::Rect& dip_rect) const; 87 const gfx::Rect& dip_rect) const;
87 88
88 // Returns true if the display with |display_id| is found and returns that 89 // Returns true if the display with |display_id| is found and returns that
89 // display in |display|. Otherwise returns false and |display| remains 90 // display in |display|. Otherwise returns false and |display| remains
90 // untouched. 91 // untouched.
91 bool GetDisplayWithDisplayId(int64_t display_id, Display* display) const; 92 bool GetDisplayWithDisplayId(int64_t display_id, Display* display) const;
92 93
93 private: 94 private:
95 static gfx::NativeWindow WindowForView(gfx::NativeView view);
96
94 DISALLOW_COPY_AND_ASSIGN(Screen); 97 DISALLOW_COPY_AND_ASSIGN(Screen);
95 }; 98 };
96 99
97 Screen* CreateNativeScreen(); 100 Screen* CreateNativeScreen();
98 101
99 } // namespace display 102 } // namespace display
100 103
101 #endif // UI_DISPLAY_SCREEN_H_ 104 #endif // UI_DISPLAY_SCREEN_H_
OLDNEW
« no previous file with comments | « ui/display/mac/screen_mac.mm ('k') | ui/display/screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698