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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 const char* CustomFrameViewAsh::GetClassName() const { | 370 const char* CustomFrameViewAsh::GetClassName() const { |
371 return kViewClassName; | 371 return kViewClassName; |
372 } | 372 } |
373 | 373 |
374 gfx::Size CustomFrameViewAsh::GetMinimumSize() const { | 374 gfx::Size CustomFrameViewAsh::GetMinimumSize() const { |
375 if (use_empty_minimum_size_for_test_) | 375 if (use_empty_minimum_size_for_test_) |
376 return gfx::Size(); | 376 return gfx::Size(); |
377 | 377 |
378 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); | 378 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); |
379 return gfx::Size( | 379 gfx::Size min_size( |
380 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()), | 380 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()), |
381 NonClientTopBorderHeight() + min_client_view_size.height()); | 381 NonClientTopBorderHeight() + min_client_view_size.height()); |
| 382 |
| 383 aura::Window* frame_window = frame_->GetNativeWindow(); |
| 384 const gfx::Size* min_window_size = |
| 385 frame_window->GetProperty(aura::client::kMinimumSize); |
| 386 if (min_window_size) |
| 387 min_size.SetToMax(*min_window_size); |
| 388 return min_size; |
382 } | 389 } |
383 | 390 |
384 gfx::Size CustomFrameViewAsh::GetMaximumSize() const { | 391 gfx::Size CustomFrameViewAsh::GetMaximumSize() const { |
385 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize()); | 392 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize()); |
386 int width = 0; | 393 int width = 0; |
387 int height = 0; | 394 int height = 0; |
388 | 395 |
389 if (max_client_size.width() > 0) | 396 if (max_client_size.width() > 0) |
390 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); | 397 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); |
391 if (max_client_size.height() > 0) | 398 if (max_client_size.height() > 0) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 FrameCaptionButtonContainerView* | 433 FrameCaptionButtonContainerView* |
427 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { | 434 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { |
428 return header_view_->caption_button_container(); | 435 return header_view_->caption_button_container(); |
429 } | 436 } |
430 | 437 |
431 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 438 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
432 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 439 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
433 } | 440 } |
434 | 441 |
435 } // namespace ash | 442 } // namespace ash |
OLD | NEW |