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 CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 5 #ifndef CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/host_desktop.h" |
10 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
11 | 12 |
12 class Browser; | 13 class Browser; |
13 | 14 |
14 // An interface implemented by an object that can retrieve information about | 15 // An interface implemented by an object that can retrieve information about |
15 // the monitors on the system. | 16 // the monitors on the system. |
16 class MonitorInfoProvider { | 17 class MonitorInfoProvider { |
17 public: | 18 public: |
18 virtual ~MonitorInfoProvider() {} | 19 virtual ~MonitorInfoProvider() {} |
19 | 20 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // See documentation for DetermineWindowBounds above. Normally, | 87 // See documentation for DetermineWindowBounds above. Normally, |
87 // |window_bounds| is calculated by calling GetLastActiveWindowState(). To | 88 // |window_bounds| is calculated by calling GetLastActiveWindowState(). To |
88 // explicitly specify a particular window to base the bounds on, pass in a | 89 // explicitly specify a particular window to base the bounds on, pass in a |
89 // non-NULL value for |browser|. | 90 // non-NULL value for |browser|. |
90 static void GetBrowserWindowBounds(const std::string& app_name, | 91 static void GetBrowserWindowBounds(const std::string& app_name, |
91 const gfx::Rect& specified_bounds, | 92 const gfx::Rect& specified_bounds, |
92 const Browser* browser, | 93 const Browser* browser, |
93 gfx::Rect* window_bounds); | 94 gfx::Rect* window_bounds); |
94 | 95 |
95 // Returns the default origin for popups of the given size. | 96 // Returns the default origin for popups of the given size. |
96 static gfx::Point GetDefaultPopupOrigin(const gfx::Size& size); | 97 static gfx::Point GetDefaultPopupOrigin(const gfx::Size& size, |
| 98 chrome::HostDesktopType type); |
97 | 99 |
98 // The number of pixels which are kept free top, left and right when a window | 100 // The number of pixels which are kept free top, left and right when a window |
99 // gets positioned to its default location. | 101 // gets positioned to its default location. |
100 static const int kDesktopBorderSize; | 102 static const int kDesktopBorderSize; |
101 | 103 |
102 // How much horizontal and vertical offset there is between newly | 104 // How much horizontal and vertical offset there is between newly |
103 // opened windows. This value may be different on each platform. | 105 // opened windows. This value may be different on each platform. |
104 static const int kWindowTilePixels; | 106 static const int kWindowTilePixels; |
105 | 107 |
106 private: | 108 private: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 scoped_ptr<StateProvider> state_provider_; | 156 scoped_ptr<StateProvider> state_provider_; |
155 scoped_ptr<MonitorInfoProvider> monitor_info_provider_; | 157 scoped_ptr<MonitorInfoProvider> monitor_info_provider_; |
156 | 158 |
157 // Note that this browser handle might be NULL. | 159 // Note that this browser handle might be NULL. |
158 const Browser* browser_; | 160 const Browser* browser_; |
159 | 161 |
160 DISALLOW_COPY_AND_ASSIGN(WindowSizer); | 162 DISALLOW_COPY_AND_ASSIGN(WindowSizer); |
161 }; | 163 }; |
162 | 164 |
163 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 165 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
OLD | NEW |