| Index: chrome/browser/ui/views/extensions/shell_window_views.cc
|
| diff --git a/chrome/browser/ui/views/extensions/shell_window_views.cc b/chrome/browser/ui/views/extensions/shell_window_views.cc
|
| index 098849b03a5dc2f6c43cea45cc1d150415cd83a2..256159a85769357749502a63fc65077804cb0567 100644
|
| --- a/chrome/browser/ui/views/extensions/shell_window_views.cc
|
| +++ b/chrome/browser/ui/views/extensions/shell_window_views.cc
|
| @@ -409,9 +409,7 @@ ShellWindowViews::ShellWindowViews(ShellWindow* shell_window,
|
| minimum_size_ = win_params.minimum_size;
|
| maximum_size_ = win_params.maximum_size;
|
| window_->Init(params);
|
| - gfx::Rect window_bounds =
|
| - window_->non_client_view()->GetWindowBoundsForClientBounds(
|
| - win_params.bounds);
|
| + gfx::Rect window_bounds = WindowBoundsForContentBounds(win_params.bounds);
|
| // Center window if no position was specified.
|
| if (win_params.bounds.x() == INT_MIN || win_params.bounds.y() == INT_MIN) {
|
| window_->CenterWindow(window_bounds.size());
|
| @@ -574,6 +572,28 @@ bool ShellWindowViews::IsAlwaysOnTop() const {
|
| return false;
|
| }
|
|
|
| +gfx::Rect ShellWindowViews::ContentBoundsForWindowBounds(
|
| + const gfx::Rect& window_bounds) const {
|
| + if (frameless()) {
|
| + return window_bounds;
|
| + } else {
|
| + gfx::Rect bounds = window_bounds;
|
| + bounds.set_height(std::max(0, bounds.height() - kCaptionHeight));
|
| + return bounds;
|
| + }
|
| +}
|
| +
|
| +gfx::Rect ShellWindowViews::WindowBoundsForContentBounds(
|
| + const gfx::Rect& content_bounds) const {
|
| + if (frameless()) {
|
| + return content_bounds;
|
| + } else {
|
| + gfx::Rect bounds = content_bounds;
|
| + bounds.set_height(bounds.height() + kCaptionHeight);
|
| + return bounds;
|
| + }
|
| +}
|
| +
|
| void ShellWindowViews::DeleteDelegate() {
|
| shell_window_->OnNativeClose();
|
| }
|
|
|