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

Side by Side Diff: apps/ui/views/app_window_frame_view.cc

Issue 296823002: views: Also const-ify GetMaximumSize(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 | « apps/ui/views/app_window_frame_view.h ('k') | apps/ui/views/native_app_window_views.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "apps/ui/views/app_window_frame_view.h" 5 #include "apps/ui/views/app_window_frame_view.h"
6 6
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "extensions/common/draggable_region.h" 9 #include "extensions/common/draggable_region.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 min_size.Enlarge(0, client_bounds.y()); 326 min_size.Enlarge(0, client_bounds.y());
327 // Ensure we have enough space for the window icon and buttons. We allow 327 // Ensure we have enough space for the window icon and buttons. We allow
328 // the title string to collapse to zero width. 328 // the title string to collapse to zero width.
329 int closeButtonOffsetX = (kCaptionHeight - close_button_->height()) / 2; 329 int closeButtonOffsetX = (kCaptionHeight - close_button_->height()) / 2;
330 int header_width = close_button_->width() + closeButtonOffsetX * 2; 330 int header_width = close_button_->width() + closeButtonOffsetX * 2;
331 if (header_width > min_size.width()) 331 if (header_width > min_size.width())
332 min_size.set_width(header_width); 332 min_size.set_width(header_width);
333 return min_size; 333 return min_size;
334 } 334 }
335 335
336 gfx::Size AppWindowFrameView::GetMaximumSize() { 336 gfx::Size AppWindowFrameView::GetMaximumSize() const {
337 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); 337 gfx::Size max_size = widget_->client_view()->GetMaximumSize();
338 338
339 // Add to the client maximum size the height of any title bar and borders. 339 // Add to the client maximum size the height of any title bar and borders.
340 gfx::Size client_size = GetBoundsForClientView().size(); 340 gfx::Size client_size = GetBoundsForClientView().size();
341 if (max_size.width()) 341 if (max_size.width())
342 max_size.Enlarge(width() - client_size.width(), 0); 342 max_size.Enlarge(width() - client_size.width(), 0);
343 if (max_size.height()) 343 if (max_size.height())
344 max_size.Enlarge(0, height() - client_size.height()); 344 max_size.Enlarge(0, height() - client_size.height());
345 345
346 return max_size; 346 return max_size;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 restore_button_->SetImage( 391 restore_button_->SetImage(
392 views::CustomButton::STATE_NORMAL, 392 views::CustomButton::STATE_NORMAL,
393 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia()); 393 rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia());
394 minimize_button_->SetImage( 394 minimize_button_->SetImage(
395 views::CustomButton::STATE_NORMAL, 395 views::CustomButton::STATE_NORMAL,
396 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia()); 396 rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia());
397 } 397 }
398 } 398 }
399 399
400 } // namespace apps 400 } // namespace apps
OLDNEW
« no previous file with comments | « apps/ui/views/app_window_frame_view.h ('k') | apps/ui/views/native_app_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698