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 = | |
388 gfx::Size(std::max(min_size.width(), min_window_size->width()), | |
389 std::max(min_size.height(), min_window_size->height())); | |
sadrul
2017/06/21 21:09:57
Maybe use min_size.SetToMin(...) instead.
varkha
2017/06/21 23:33:27
I take it you meant SetToMax(). Done.
| |
390 } | |
391 return min_size; | |
382 } | 392 } |
383 | 393 |
384 gfx::Size CustomFrameViewAsh::GetMaximumSize() const { | 394 gfx::Size CustomFrameViewAsh::GetMaximumSize() const { |
385 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize()); | 395 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize()); |
386 int width = 0; | 396 int width = 0; |
387 int height = 0; | 397 int height = 0; |
388 | 398 |
389 if (max_client_size.width() > 0) | 399 if (max_client_size.width() > 0) |
390 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); | 400 width = std::max(header_view_->GetMinimumWidth(), max_client_size.width()); |
391 if (max_client_size.height() > 0) | 401 if (max_client_size.height() > 0) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 FrameCaptionButtonContainerView* | 436 FrameCaptionButtonContainerView* |
427 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { | 437 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { |
428 return header_view_->caption_button_container(); | 438 return header_view_->caption_button_container(); |
429 } | 439 } |
430 | 440 |
431 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 441 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
432 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 442 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
433 } | 443 } |
434 | 444 |
435 } // namespace ash | 445 } // namespace ash |
OLD | NEW |