| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 bool GetBrowserBoundsAsh(gfx::Rect* bounds, | 166 bool GetBrowserBoundsAsh(gfx::Rect* bounds, |
| 167 ui::WindowShowState* show_state) const; | 167 ui::WindowShowState* show_state) const; |
| 168 | 168 |
| 169 // Calls GetBrowserBoundsAsh and then adjusts the |bounds| (to |
| 170 // default bounds) and |show_state| (to SHOW_STATE_MAXIMIZED) if the window |
| 171 // is too big to fit in the display work area. |
| 172 bool GetBrowserBoundsAshAdjusted(gfx::Rect* bounds, |
| 173 ui::WindowShowState* show_state) const; |
| 174 |
| 169 // Determines the position and size for a tabbed browser window in | 175 // Determines the position and size for a tabbed browser window in |
| 170 // ash as it gets created. This will be called before other standard | 176 // ash as it gets created. This will be called before other standard |
| 171 // placement logic. |show_state| will only be changed | 177 // placement logic. |show_state| will only be changed |
| 172 // if it was set to SHOW_STATE_DEFAULT. | 178 // if it was set to SHOW_STATE_DEFAULT. |
| 173 void GetTabbedBrowserBoundsAsh(gfx::Rect* bounds, | 179 void GetTabbedBrowserBoundsAsh(gfx::Rect* bounds, |
| 174 ui::WindowShowState* show_state) const; | 180 ui::WindowShowState* show_state) const; |
| 175 #endif | 181 #endif |
| 176 | 182 |
| 177 // Determine the default show state for the window - not looking at other | 183 // Determine the default show state for the window - not looking at other |
| 178 // windows or at persistent information. | 184 // windows or at persistent information. |
| 179 ui::WindowShowState GetWindowDefaultShowState() const; | 185 ui::WindowShowState GetWindowDefaultShowState() const; |
| 180 | 186 |
| 181 // Providers for persistent storage and monitor metrics. | 187 // Providers for persistent storage and monitor metrics. |
| 182 scoped_ptr<StateProvider> state_provider_; | 188 scoped_ptr<StateProvider> state_provider_; |
| 183 scoped_ptr<TargetDisplayProvider> target_display_provider_; | 189 scoped_ptr<TargetDisplayProvider> target_display_provider_; |
| 184 gfx::Screen* screen_; // not owned. | 190 gfx::Screen* screen_; // not owned. |
| 185 | 191 |
| 186 // Note that this browser handle might be NULL. | 192 // Note that this browser handle might be NULL. |
| 187 const Browser* browser_; | 193 const Browser* browser_; |
| 188 | 194 |
| 189 DISALLOW_COPY_AND_ASSIGN(WindowSizer); | 195 DISALLOW_COPY_AND_ASSIGN(WindowSizer); |
| 190 }; | 196 }; |
| 191 | 197 |
| 192 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 198 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
| OLD | NEW |