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/ash_constants.h" |
7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
10 #include "base/logging.h" // DCHECK | 11 #include "base/logging.h" // DCHECK |
11 #include "grit/ui_resources.h" | 12 #include "grit/ui_resources.h" |
12 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
13 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
14 #include "third_party/skia/include/core/SkPaint.h" | 15 #include "third_party/skia/include/core/SkPaint.h" |
15 #include "third_party/skia/include/core/SkPath.h" | 16 #include "third_party/skia/include/core/SkPath.h" |
16 #include "ui/aura/client/aura_constants.h" | 17 #include "ui/aura/client/aura_constants.h" |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 return kActiveWindowOpacity; | 603 return kActiveWindowOpacity; |
603 return kInactiveWindowOpacity; | 604 return kInactiveWindowOpacity; |
604 } | 605 } |
605 | 606 |
606 // static | 607 // static |
607 bool FramePainter::UseSoloWindowHeader() { | 608 bool FramePainter::UseSoloWindowHeader() { |
608 int window_count = 0; | 609 int window_count = 0; |
609 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); | 610 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); |
610 it != instances_->end(); | 611 it != instances_->end(); |
611 ++it) { | 612 ++it) { |
612 if (IsVisibleNormalWindow((*it)->window_)) { | 613 // The window needs to be a 'normal window'. To exclude constrained windows |
| 614 // the existence of a layout manager gets additionally tested. |
| 615 if (IsVisibleNormalWindow((*it)->window_) && |
| 616 (!(*it)->window_->GetProperty(ash::kConstrainedWindowKey))) { |
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 |