| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/host_desktop.h" | |
| 11 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 13 | 12 |
| 14 class Browser; | 13 class Browser; |
| 15 | 14 |
| 16 namespace gfx { | 15 namespace gfx { |
| 17 class Display; | 16 class Display; |
| 18 class Screen; | 17 class Screen; |
| 19 } | 18 } |
| 20 | 19 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // explicitly specify a particular window to base the bounds on, pass in a | 100 // explicitly specify a particular window to base the bounds on, pass in a |
| 102 // non-NULL value for |browser|. | 101 // non-NULL value for |browser|. |
| 103 static void GetBrowserWindowBoundsAndShowState( | 102 static void GetBrowserWindowBoundsAndShowState( |
| 104 const std::string& app_name, | 103 const std::string& app_name, |
| 105 const gfx::Rect& specified_bounds, | 104 const gfx::Rect& specified_bounds, |
| 106 const Browser* browser, | 105 const Browser* browser, |
| 107 gfx::Rect* window_bounds, | 106 gfx::Rect* window_bounds, |
| 108 ui::WindowShowState* show_state); | 107 ui::WindowShowState* show_state); |
| 109 | 108 |
| 110 // Returns the default origin for popups of the given size. | 109 // Returns the default origin for popups of the given size. |
| 111 static gfx::Point GetDefaultPopupOrigin(const gfx::Size& size, | 110 static gfx::Point GetDefaultPopupOrigin(const gfx::Size& size); |
| 112 chrome::HostDesktopType type); | |
| 113 | 111 |
| 114 // How much horizontal and vertical offset there is between newly | 112 // How much horizontal and vertical offset there is between newly |
| 115 // opened windows. This value may be different on each platform. | 113 // opened windows. This value may be different on each platform. |
| 116 static const int kWindowTilePixels; | 114 static const int kWindowTilePixels; |
| 117 | 115 |
| 118 private: | 116 private: |
| 119 // The edge of the screen to check for out-of-bounds. | 117 // The edge of the screen to check for out-of-bounds. |
| 120 enum Edge { TOP, LEFT, BOTTOM, RIGHT }; | 118 enum Edge { TOP, LEFT, BOTTOM, RIGHT }; |
| 121 | 119 |
| 122 // Gets the size and placement of the last active window. Returns true if this | 120 // Gets the size and placement of the last active window. Returns true if this |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 scoped_ptr<TargetDisplayProvider> target_display_provider_; | 184 scoped_ptr<TargetDisplayProvider> target_display_provider_; |
| 187 gfx::Screen* screen_; // not owned. | 185 gfx::Screen* screen_; // not owned. |
| 188 | 186 |
| 189 // Note that this browser handle might be NULL. | 187 // Note that this browser handle might be NULL. |
| 190 const Browser* browser_; | 188 const Browser* browser_; |
| 191 | 189 |
| 192 DISALLOW_COPY_AND_ASSIGN(WindowSizer); | 190 DISALLOW_COPY_AND_ASSIGN(WindowSizer); |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ | 193 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_H_ |
| OLD | NEW |