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

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

Issue 183793011: App windows on ChromeOS cannot be sized to their maximum height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appwindow_chromeos_insets
Patch Set: Created 6 years, 9 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
« no previous file with comments | « ash/wm/custom_frame_view_ash.h ('k') | ash/wm/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/wm/custom_frame_view_ash.h" 5 #include "ash/wm/custom_frame_view_ash.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" 8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/wm/caption_buttons/frame_maximize_button.h" 9 #include "ash/wm/caption_buttons/frame_maximize_button.h"
10 #include "ash/wm/caption_buttons/frame_maximize_button_observer.h" 10 #include "ash/wm/caption_buttons/frame_maximize_button_observer.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 468 }
469 469
470 gfx::Size CustomFrameViewAsh::GetMinimumSize() { 470 gfx::Size CustomFrameViewAsh::GetMinimumSize() {
471 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize()); 471 gfx::Size min_client_view_size(frame_->client_view()->GetMinimumSize());
472 return gfx::Size( 472 return gfx::Size(
473 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()), 473 std::max(header_view_->GetMinimumWidth(), min_client_view_size.width()),
474 NonClientTopBorderHeight() + min_client_view_size.height()); 474 NonClientTopBorderHeight() + min_client_view_size.height());
475 } 475 }
476 476
477 gfx::Size CustomFrameViewAsh::GetMaximumSize() { 477 gfx::Size CustomFrameViewAsh::GetMaximumSize() {
478 return frame_->client_view()->GetMaximumSize(); 478 gfx::Size max_client_size(frame_->client_view()->GetMaximumSize());
479 return gfx::Size(
480 max_client_size.width() == 0
481 ? 0
482 : std::max(header_view_->GetMinimumWidth(), max_client_size.width()),
483 max_client_size.height() == 0
484 ? 0
485 : NonClientTopBorderHeight() + max_client_size.height());
pkotwicz 2014/03/07 01:45:14 Optional Nit: This might be easier to read int wi
tmdiep 2014/03/07 02:08:35 Done.
479 } 486 }
480 487
481 void CustomFrameViewAsh::SchedulePaintInRect(const gfx::Rect& r) { 488 void CustomFrameViewAsh::SchedulePaintInRect(const gfx::Rect& r) {
482 // We may end up here before |header_view_| has been added to the Widget. 489 // We may end up here before |header_view_| has been added to the Widget.
483 if (header_view_->GetWidget()) { 490 if (header_view_->GetWidget()) {
484 // The HeaderView is not a child of CustomFrameViewAsh. Redirect the paint 491 // The HeaderView is not a child of CustomFrameViewAsh. Redirect the paint
485 // to HeaderView instead. 492 // to HeaderView instead.
486 gfx::RectF to_paint(r); 493 gfx::RectF to_paint(r);
487 views::View::ConvertRectToTarget(this, header_view_, &to_paint); 494 views::View::ConvertRectToTarget(this, header_view_, &to_paint);
488 header_view_->SchedulePaintInRect(gfx::ToEnclosingRect(to_paint)); 495 header_view_->SchedulePaintInRect(gfx::ToEnclosingRect(to_paint));
(...skipping 13 matching lines...) Expand all
502 } 509 }
503 510
504 //////////////////////////////////////////////////////////////////////////////// 511 ////////////////////////////////////////////////////////////////////////////////
505 // CustomFrameViewAsh, private: 512 // CustomFrameViewAsh, private:
506 513
507 int CustomFrameViewAsh::NonClientTopBorderHeight() const { 514 int CustomFrameViewAsh::NonClientTopBorderHeight() const {
508 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); 515 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight();
509 } 516 }
510 517
511 } // namespace ash 518 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/custom_frame_view_ash.h ('k') | ash/wm/custom_frame_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698