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 UI_GFX_SCREEN_WIN_H_ | 5 #ifndef UI_GFX_SCREEN_WIN_H_ |
| 6 #define UI_GFX_SCREEN_WIN_H_ | 6 #define UI_GFX_SCREEN_WIN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | |
| 9 | |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 12 #include "ui/gfx/display_change_notifier.h" | 14 #include "ui/gfx/display_change_notifier.h" |
| 13 #include "ui/gfx/gfx_export.h" | 15 #include "ui/gfx/gfx_export.h" |
| 14 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 15 #include "ui/gfx/win/singleton_hwnd_observer.h" | 17 #include "ui/gfx/win/singleton_hwnd_observer.h" |
| 16 | 18 |
| 17 namespace gfx { | 19 namespace gfx { |
| 18 | 20 |
| 19 class GFX_EXPORT ScreenWin : public Screen { | 21 class GFX_EXPORT ScreenWin : public Screen { |
| 20 public: | 22 public: |
| 21 ScreenWin(); | 23 ScreenWin(); |
| 22 ~ScreenWin() override; | 24 ~ScreenWin() override; |
| 23 | 25 |
| 24 // Returns the HWND associated with the NativeView. | 26 // Returns the HWND associated with the NativeView. |
| 25 virtual HWND GetHWNDFromNativeView(NativeView window) const; | 27 virtual HWND GetHWNDFromNativeView(NativeView window) const; |
| 26 | 28 |
| 27 // Returns the NativeView associated with the HWND. | 29 // Returns the NativeView associated with the HWND. |
| 28 virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; | 30 virtual NativeWindow GetNativeWindowFromHWND(HWND hwnd) const; |
| 29 | 31 |
| 32 static int64_t GenerateDisplayId(const std::wstring& str); | |
|
scottmg
2016/01/09 01:00:05
#include <string> for std::wstring.
It looks like
robliao
2016/01/11 18:42:20
Alternatively, you can do...
static int64_t HashDe
Bret
2016/01/12 00:23:46
Done. I went with Scott's suggestion, since displa
| |
| 33 | |
| 30 protected: | 34 protected: |
| 31 // Overridden from gfx::Screen: | 35 // Overridden from gfx::Screen: |
| 32 gfx::Point GetCursorScreenPoint() override; | 36 gfx::Point GetCursorScreenPoint() override; |
| 33 gfx::NativeWindow GetWindowUnderCursor() override; | 37 gfx::NativeWindow GetWindowUnderCursor() override; |
| 34 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; | 38 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; |
| 35 int GetNumDisplays() const override; | 39 int GetNumDisplays() const override; |
| 36 std::vector<gfx::Display> GetAllDisplays() const override; | 40 std::vector<gfx::Display> GetAllDisplays() const override; |
| 37 gfx::Display GetDisplayNearestWindow(gfx::NativeView window) const override; | 41 gfx::Display GetDisplayNearestWindow(gfx::NativeView window) const override; |
| 38 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; | 42 gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; |
| 39 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; | 43 gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 57 | 61 |
| 58 // Current list of displays. | 62 // Current list of displays. |
| 59 std::vector<gfx::Display> displays_; | 63 std::vector<gfx::Display> displays_; |
| 60 | 64 |
| 61 DISALLOW_COPY_AND_ASSIGN(ScreenWin); | 65 DISALLOW_COPY_AND_ASSIGN(ScreenWin); |
| 62 }; | 66 }; |
| 63 | 67 |
| 64 } // namespace gfx | 68 } // namespace gfx |
| 65 | 69 |
| 66 #endif // UI_GFX_SCREEN_WIN_H_ | 70 #endif // UI_GFX_SCREEN_WIN_H_ |
| OLD | NEW |