Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: ash/wm/frame_painter.cc

Issue 11366215: Prevents windows in chromeos from resizing bigger than their maximum size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DesktopNativeWidgetAura Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/frame_painter.h ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ash/wm/frame_painter.h" 5 #include "ash/wm/frame_painter.h"
6 6
7 #include "ash/ash_constants.h" 7 #include "ash/ash_constants.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/property_util.h" 10 #include "ash/wm/property_util.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 int title_width = GetTitleOffsetX() + 322 int title_width = GetTitleOffsetX() +
323 size_button_->width() + kSizeButtonOffsetX + 323 size_button_->width() + kSizeButtonOffsetX +
324 close_button_->width() + kCloseButtonOffsetX; 324 close_button_->width() + kCloseButtonOffsetX;
325 if (immersive_button_) 325 if (immersive_button_)
326 title_width += immersive_button_->width() + kImmersiveButtonOffsetX; 326 title_width += immersive_button_->width() + kImmersiveButtonOffsetX;
327 if (title_width > min_size.width()) 327 if (title_width > min_size.width())
328 min_size.set_width(title_width); 328 min_size.set_width(title_width);
329 return min_size; 329 return min_size;
330 } 330 }
331 331
332 gfx::Size FramePainter::GetMaximumSize(views::NonClientFrameView* view) {
333 return frame_->client_view()->GetMaximumSize();
334 }
335
332 int FramePainter::GetRightInset() const { 336 int FramePainter::GetRightInset() const {
333 gfx::Size close_size = close_button_->GetPreferredSize(); 337 gfx::Size close_size = close_button_->GetPreferredSize();
334 gfx::Size size_button_size = size_button_->GetPreferredSize(); 338 gfx::Size size_button_size = size_button_->GetPreferredSize();
335 int inset = close_size.width() + kCloseButtonOffsetX + 339 int inset = close_size.width() + kCloseButtonOffsetX +
336 size_button_size.width() + kSizeButtonOffsetX; 340 size_button_size.width() + kSizeButtonOffsetX;
337 if (immersive_button_) { 341 if (immersive_button_) {
338 gfx::Size immersive_size = immersive_button_->GetPreferredSize(); 342 gfx::Size immersive_size = immersive_button_->GetPreferredSize();
339 inset += immersive_size.width() + kImmersiveButtonOffsetX; 343 inset += immersive_size.width() + kImmersiveButtonOffsetX;
340 } 344 }
341 return inset; 345 return inset;
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 int title_y = 876 int title_y =
873 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2; 877 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2;
874 return gfx::Rect( 878 return gfx::Rect(
875 title_x, 879 title_x,
876 std::max(0, title_y), 880 std::max(0, title_y),
877 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x), 881 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x),
878 title_font.GetHeight()); 882 title_font.GetHeight());
879 } 883 }
880 884
881 } // namespace ash 885 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/frame_painter.h ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698