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

Side by Side Diff: ash/frame/custom_frame_view_ash.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT 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 | « ash/frame/custom_frame_view_ash.h ('k') | ash/frame/custom_frame_view_ash_unittest.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/frame/custom_frame_view_ash.h" 5 #include "ash/frame/custom_frame_view_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/default_header_painter.h" 9 #include "ash/frame/default_header_painter.h"
10 #include "ash/frame/frame_border_hit_test_controller.h" 10 #include "ash/frame/frame_border_hit_test_controller.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 void CustomFrameViewAsh::UpdateWindowIcon() { 460 void CustomFrameViewAsh::UpdateWindowIcon() {
461 } 461 }
462 462
463 void CustomFrameViewAsh::UpdateWindowTitle() { 463 void CustomFrameViewAsh::UpdateWindowTitle() {
464 header_view_->SchedulePaintForTitle(); 464 header_view_->SchedulePaintForTitle();
465 } 465 }
466 466
467 //////////////////////////////////////////////////////////////////////////////// 467 ////////////////////////////////////////////////////////////////////////////////
468 // CustomFrameViewAsh, views::View overrides: 468 // CustomFrameViewAsh, views::View overrides:
469 469
470 gfx::Size CustomFrameViewAsh::GetPreferredSize() { 470 gfx::Size CustomFrameViewAsh::GetPreferredSize() const {
471 gfx::Size pref = frame_->client_view()->GetPreferredSize(); 471 gfx::Size pref = frame_->client_view()->GetPreferredSize();
472 gfx::Rect bounds(0, 0, pref.width(), pref.height()); 472 gfx::Rect bounds(0, 0, pref.width(), pref.height());
473 return frame_->non_client_view()->GetWindowBoundsForClientBounds( 473 return frame_->non_client_view()->GetWindowBoundsForClientBounds(
474 bounds).size(); 474 bounds).size();
475 } 475 }
476 476
477 const char* CustomFrameViewAsh::GetClassName() const { 477 const char* CustomFrameViewAsh::GetClassName() const {
478 return kViewClassName; 478 return kViewClassName;
479 } 479 }
480 480
481 gfx::Size CustomFrameViewAsh::GetMinimumSize() { 481 gfx::Size CustomFrameViewAsh::GetMinimumSize() const {
482 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); 482 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize());
483 return gfx::Size( 483 return gfx::Size(
484 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()), 484 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()),
485 NonClientTopBorderHeight() + min_client_view_size.height()); 485 NonClientTopBorderHeight() + min_client_view_size.height());
486 } 486 }
487 487
488 gfx::Size CustomFrameViewAsh::GetMaximumSize() { 488 gfx::Size CustomFrameViewAsh::GetMaximumSize() {
489 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize()); 489 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize());
490 int width = 0; 490 int width = 0;
491 int height = 0; 491 int height = 0;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 FrameCaptionButtonContainerView* CustomFrameViewAsh:: 537 FrameCaptionButtonContainerView* CustomFrameViewAsh::
538 GetFrameCaptionButtonContainerViewForTest() { 538 GetFrameCaptionButtonContainerViewForTest() {
539 return header_view_->caption_button_container(); 539 return header_view_->caption_button_container();
540 } 540 }
541 541
542 int CustomFrameViewAsh::NonClientTopBorderHeight() const { 542 int CustomFrameViewAsh::NonClientTopBorderHeight() const {
543 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); 543 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight();
544 } 544 }
545 545
546 } // namespace ash 546 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/custom_frame_view_ash.h ('k') | ash/frame/custom_frame_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698