| 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 "chrome/browser/ui/host_desktop.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 // Determine the target display for a new window based on | 157 // Determine the target display for a new window based on |
| 158 // |bounds|. On ash environment, this returns the display containing | 158 // |bounds|. On ash environment, this returns the display containing |
| 159 // ash's the target root window. | 159 // ash's the target root window. |
| 160 gfx::Display GetTargetDisplay(const gfx::Rect& bounds) const; | 160 gfx::Display GetTargetDisplay(const gfx::Rect& bounds) const; |
| 161 | 161 |
| 162 #if defined(USE_ASH) | 162 #if defined(USE_ASH) |
| 163 // Ash specific logic for window placement. Returns true if |bounds| and | 163 // Ash specific logic for window placement. Returns true if |bounds| and |
| 164 // |show_state| have been fully determined, otherwise returns false (but | 164 // |show_state| have been fully determined, otherwise returns false (but |
| 165 // may still affect |show_state|). | 165 // may still affect |show_state|). |
| 166 // If the window is too big to fit in the display work area then the |bounds| |
| 167 // are adjusted to default bounds and the |show_state| is adjusted to |
| 168 // SHOW_STATE_MAXIMIZED. |
| 166 bool GetBrowserBoundsAsh(gfx::Rect* bounds, | 169 bool GetBrowserBoundsAsh(gfx::Rect* bounds, |
| 167 ui::WindowShowState* show_state) const; | 170 ui::WindowShowState* show_state) const; |
| 168 | 171 |
| 169 // Determines the position and size for a tabbed browser window in | 172 // Determines the position and size for a tabbed browser window in |
| 170 // ash as it gets created. This will be called before other standard | 173 // ash as it gets created. This will be called before other standard |
| 171 // placement logic. |show_state| will only be changed | 174 // placement logic. |show_state| will only be changed |
| 172 // if it was set to SHOW_STATE_DEFAULT. | 175 // if it was set to SHOW_STATE_DEFAULT. |
| 173 void GetTabbedBrowserBoundsAsh(gfx::Rect* bounds, | 176 void GetTabbedBrowserBoundsAsh(gfx::Rect* bounds, |
| 174 ui::WindowShowState* show_state) const; | 177 ui::WindowShowState* show_state) const; |
| 175 #endif | 178 #endif |
| 176 | 179 |
| 177 // Determine the default show state for the window - not looking at other | 180 // Determine the default show state for the window - not looking at other |
| 178 // windows or at persistent information. | 181 // windows or at persistent information. |
| 179 ui::WindowShowState GetWindowDefaultShowState() const; | 182 ui::WindowShowState GetWindowDefaultShowState() const; |
| 180 | 183 |
| 181 // Providers for persistent storage and monitor metrics. | 184 // Providers for persistent storage and monitor metrics. |
| 182 scoped_ptr<StateProvider> state_provider_; | 185 scoped_ptr<StateProvider> state_provider_; |
| 183 scoped_ptr<TargetDisplayProvider> target_display_provider_; | 186 scoped_ptr<TargetDisplayProvider> target_display_provider_; |
| 184 gfx::Screen* screen_; // not owned. | 187 gfx::Screen* screen_; // not owned. |
| 185 | 188 |
| 186 // Note that this browser handle might be NULL. | 189 // Note that this browser handle might be NULL. |
| 187 const Browser* browser_; | 190 const Browser* browser_; |
| 188 | 191 |
| 189 DISALLOW_COPY_AND_ASSIGN(WindowSizer); | 192 DISALLOW_COPY_AND_ASSIGN(WindowSizer); |
| 190 }; | 193 }; |
| 191 | 194 |
| 192 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 195 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
| OLD | NEW |