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 20 matching lines...) Expand all Loading... |
31 // TODO(oshima): gfx::Screen needs to return translated coordinates | 31 // TODO(oshima): gfx::Screen needs to return translated coordinates |
32 // if the root window is translated. crbug.com/119268. | 32 // if the root window is translated. crbug.com/119268. |
33 class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager, | 33 class ASH_EXPORT MultiDisplayManager : public aura::DisplayManager, |
34 public aura::RootWindowObserver { | 34 public aura::RootWindowObserver { |
35 public: | 35 public: |
36 MultiDisplayManager(); | 36 MultiDisplayManager(); |
37 virtual ~MultiDisplayManager(); | 37 virtual ~MultiDisplayManager(); |
38 | 38 |
39 // Used to emulate display change when run in a desktop environment instead | 39 // Used to emulate display change when run in a desktop environment instead |
40 // of on a device. | 40 // of on a device. |
41 static void AddRemoveDisplay(); | |
42 static void CycleDisplay(); | 41 static void CycleDisplay(); |
43 static void ToggleDisplayScale(); | 42 static void ToggleDisplayScale(); |
44 | 43 |
45 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window, | 44 bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window, |
46 const gfx::Insets& insets); | 45 const gfx::Insets& insets); |
47 | 46 |
48 // DisplayManager overrides: | 47 // DisplayManager overrides: |
49 virtual void OnNativeDisplaysChanged( | 48 virtual void OnNativeDisplaysChanged( |
50 const std::vector<gfx::Display>& displays) OVERRIDE; | 49 const std::vector<gfx::Display>& displays) OVERRIDE; |
51 virtual aura::RootWindow* CreateRootWindowForDisplay( | 50 virtual aura::RootWindow* CreateRootWindowForDisplay( |
(...skipping 11 matching lines...) Expand all Loading... |
63 | 62 |
64 // RootWindowObserver overrides: | 63 // RootWindowObserver overrides: |
65 virtual void OnRootWindowResized(const aura::RootWindow* root, | 64 virtual void OnRootWindowResized(const aura::RootWindow* root, |
66 const gfx::Size& new_size) OVERRIDE; | 65 const gfx::Size& new_size) OVERRIDE; |
67 | 66 |
68 private: | 67 private: |
69 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); | 68 FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, ConvertPoint); |
70 typedef std::vector<gfx::Display> Displays; | 69 typedef std::vector<gfx::Display> Displays; |
71 | 70 |
72 void Init(); | 71 void Init(); |
73 void AddRemoveDisplayImpl(); | |
74 void CycleDisplayImpl(); | 72 void CycleDisplayImpl(); |
75 void ScaleDisplayImpl(); | 73 void ScaleDisplayImpl(); |
76 gfx::Display& FindDisplayForRootWindow(const aura::RootWindow* root); | 74 gfx::Display& FindDisplayForRootWindow(const aura::RootWindow* root); |
77 | 75 |
78 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for | 76 // Refer to |aura::DisplayManager::CreateDisplayFromSpec| API for |
79 // the format of |spec|. | 77 // the format of |spec|. |
80 void AddDisplayFromSpec(const std::string& spec); | 78 void AddDisplayFromSpec(const std::string& spec); |
81 | 79 |
82 Displays displays_; | 80 Displays displays_; |
83 | 81 |
84 DISALLOW_COPY_AND_ASSIGN(MultiDisplayManager); | 82 DISALLOW_COPY_AND_ASSIGN(MultiDisplayManager); |
85 }; | 83 }; |
86 | 84 |
87 extern const aura::WindowProperty<int64>* const kDisplayIdKey; | 85 extern const aura::WindowProperty<int64>* const kDisplayIdKey; |
88 | 86 |
89 } // namespace internal | 87 } // namespace internal |
90 } // namespace ash | 88 } // namespace ash |
91 | 89 |
92 #endif // ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ | 90 #endif // ASH_DISPLAY_MULTI_DISPLAY_MANAGER_H_ |
OLD | NEW |