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_->parent() || | |
616 (*it)->window_->parent()->layout_manager())) { | |
Ben Goodger (Google)
2012/07/31 17:59:35
hrm... this seems like it could be brittle, for ex
Mr4D (OOO till 08-26)
2012/07/31 19:37:26
I added a property flag which seems to be a better
| |
613 window_count++; | 617 window_count++; |
614 if (window_count > 1) | 618 if (window_count > 1) |
615 return false; | 619 return false; |
616 } | 620 } |
617 } | 621 } |
618 return window_count == 1; | 622 return window_count == 1; |
619 } | 623 } |
620 | 624 |
621 // static | 625 // static |
622 void FramePainter::SchedulePaintForSoloWindow() { | 626 void FramePainter::SchedulePaintForSoloWindow() { |
623 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); | 627 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); |
624 it != instances_->end(); | 628 it != instances_->end(); |
625 ++it) { | 629 ++it) { |
626 FramePainter* painter = *it; | 630 FramePainter* painter = *it; |
627 if (IsVisibleNormalWindow(painter->window_)) | 631 if (IsVisibleNormalWindow(painter->window_)) |
628 painter->frame_->non_client_view()->SchedulePaint(); | 632 painter->frame_->non_client_view()->SchedulePaint(); |
629 } | 633 } |
630 } | 634 } |
631 | 635 |
632 } // namespace ash | 636 } // namespace ash |
OLD | NEW |