| 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/wm/frame_painter.h" | 5 #include "ash/wm/frame_painter.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "base/logging.h" // DCHECK | 10 #include "base/logging.h" // DCHECK |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 return kActiveWindowOpacity; | 602 return kActiveWindowOpacity; |
| 603 return kInactiveWindowOpacity; | 603 return kInactiveWindowOpacity; |
| 604 } | 604 } |
| 605 | 605 |
| 606 // static | 606 // static |
| 607 bool FramePainter::UseSoloWindowHeader() { | 607 bool FramePainter::UseSoloWindowHeader() { |
| 608 int window_count = 0; | 608 int window_count = 0; |
| 609 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); | 609 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); |
| 610 it != instances_->end(); | 610 it != instances_->end(); |
| 611 ++it) { | 611 ++it) { |
| 612 if (IsVisibleNormalWindow((*it)->window_)) { | 612 // The window needs to be a 'normal window'. To exclude constrained windows |
| 613 // the existence of a layout manager gets additionally tested. |
| 614 if (IsVisibleNormalWindow((*it)->window_) && |
| 615 (!(*it)->window_->GetProperty(aura::client::kConstrainedWindowKey))) { |
| 613 window_count++; | 616 window_count++; |
| 614 if (window_count > 1) | 617 if (window_count > 1) |
| 615 return false; | 618 return false; |
| 616 } | 619 } |
| 617 } | 620 } |
| 618 return window_count == 1; | 621 return window_count == 1; |
| 619 } | 622 } |
| 620 | 623 |
| 621 // static | 624 // static |
| 622 void FramePainter::SchedulePaintForSoloWindow() { | 625 void FramePainter::SchedulePaintForSoloWindow() { |
| 623 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); | 626 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); |
| 624 it != instances_->end(); | 627 it != instances_->end(); |
| 625 ++it) { | 628 ++it) { |
| 626 FramePainter* painter = *it; | 629 FramePainter* painter = *it; |
| 627 if (IsVisibleNormalWindow(painter->window_)) | 630 if (IsVisibleNormalWindow(painter->window_)) |
| 628 painter->frame_->non_client_view()->SchedulePaint(); | 631 painter->frame_->non_client_view()->SchedulePaint(); |
| 629 } | 632 } |
| 630 } | 633 } |
| 631 | 634 |
| 632 } // namespace ash | 635 } // namespace ash |
| OLD | NEW |