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

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

Issue 618413002: Check for NULL NativeView in linux/mac Screen::GetDisplayNearestWindow(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment to screen.h Created 6 years, 2 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 | « no previous file | ui/gfx/screen_mac.mm » ('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_GFX_SCREEN_H_ 5 #ifndef UI_GFX_SCREEN_H_
6 #define UI_GFX_SCREEN_H_ 6 #define UI_GFX_SCREEN_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 // Returns the number of displays. 65 // Returns the number of displays.
66 // Mirrored displays are excluded; this method is intended to return the 66 // Mirrored displays are excluded; this method is intended to return the
67 // number of distinct, usable displays. 67 // number of distinct, usable displays.
68 virtual int GetNumDisplays() const = 0; 68 virtual int GetNumDisplays() const = 0;
69 69
70 // Returns the list of displays that are currently available. 70 // Returns the list of displays that are currently available.
71 virtual std::vector<gfx::Display> GetAllDisplays() const = 0; 71 virtual std::vector<gfx::Display> GetAllDisplays() const = 0;
72 72
73 // Returns the display nearest the specified window. 73 // Returns the display nearest the specified window.
74 // If the window is NULL or the window is not rooted to a display this will
lazyboy 2014/10/02 16:16:21 I've added this comment, if that's what you meant.
75 // return the primary display.
74 virtual gfx::Display GetDisplayNearestWindow(NativeView view) const = 0; 76 virtual gfx::Display GetDisplayNearestWindow(NativeView view) const = 0;
75 77
76 // Returns the display nearest the specified point. 78 // Returns the display nearest the specified point.
77 virtual gfx::Display GetDisplayNearestPoint( 79 virtual gfx::Display GetDisplayNearestPoint(
78 const gfx::Point& point) const = 0; 80 const gfx::Point& point) const = 0;
79 81
80 // Returns the display that most closely intersects the provided bounds. 82 // Returns the display that most closely intersects the provided bounds.
81 virtual gfx::Display GetDisplayMatching( 83 virtual gfx::Display GetDisplayMatching(
82 const gfx::Rect& match_rect) const = 0; 84 const gfx::Rect& match_rect) const = 0;
83 85
84 // Returns the primary display. 86 // Returns the primary display.
85 virtual gfx::Display GetPrimaryDisplay() const = 0; 87 virtual gfx::Display GetPrimaryDisplay() const = 0;
86 88
87 // Adds/Removes display observers. 89 // Adds/Removes display observers.
88 virtual void AddObserver(DisplayObserver* observer) = 0; 90 virtual void AddObserver(DisplayObserver* observer) = 0;
89 virtual void RemoveObserver(DisplayObserver* observer) = 0; 91 virtual void RemoveObserver(DisplayObserver* observer) = 0;
90 92
91 private: 93 private:
92 DISALLOW_COPY_AND_ASSIGN(Screen); 94 DISALLOW_COPY_AND_ASSIGN(Screen);
93 }; 95 };
94 96
95 Screen* CreateNativeScreen(); 97 Screen* CreateNativeScreen();
96 98
97 } // namespace gfx 99 } // namespace gfx
98 100
99 #endif // UI_GFX_SCREEN_H_ 101 #endif // UI_GFX_SCREEN_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698