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 #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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return kViewClassName; | 478 return kViewClassName; |
479 } | 479 } |
480 | 480 |
481 gfx::Size CustomFrameViewAsh::GetMinimumSize() const { | 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() const { |
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; |
492 | 492 |
493 if (max_client_size.width() > 0) | 493 if (max_client_size.width() > 0) |
494 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); | 494 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); |
495 if (max_client_size.height() > 0) | 495 if (max_client_size.height() > 0) |
496 height = NonClientTopBorderHeight() + max_client_size.height(); | 496 height = NonClientTopBorderHeight() + max_client_size.height(); |
497 | 497 |
498 return gfx::Size(width, height); | 498 return gfx::Size(width, height); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |