OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/solo_window_tracker.h" | 5 #include "ash/wm/solo_window_tracker.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 return true; | 50 return true; |
51 } | 51 } |
52 | 52 |
53 // Returns true if |window| can use the solo window header. Returns false for | 53 // Returns true if |window| can use the solo window header. Returns false for |
54 // windows that are: | 54 // windows that are: |
55 // * Not drawn (for example, DragDropTracker uses one for mouse capture) | 55 // * Not drawn (for example, DragDropTracker uses one for mouse capture) |
56 // * Modal alerts (it looks odd for headers to change when an alert opens) | 56 // * Modal alerts (it looks odd for headers to change when an alert opens) |
57 // * Constrained windows (ditto) | 57 // * Constrained windows (ditto) |
58 bool IsValidCandidate(aura::Window* window) { | 58 bool IsValidCandidate(aura::Window* window) { |
59 return window->type() == aura::client::WINDOW_TYPE_NORMAL && | 59 return window->type() == ui::wm::WINDOW_TYPE_NORMAL && window->layer() && |
60 window->layer() && | 60 window->layer()->type() != ui::LAYER_NOT_DRAWN && |
61 window->layer()->type() != ui::LAYER_NOT_DRAWN && | 61 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && |
62 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && | 62 !window->GetProperty(aura::client::kConstrainedWindowKey); |
63 !window->GetProperty(aura::client::kConstrainedWindowKey); | |
64 } | 63 } |
65 | 64 |
66 // Schedule's a paint of the window's entire bounds. | 65 // Schedule's a paint of the window's entire bounds. |
67 void SchedulePaint(aura::Window* window) { | 66 void SchedulePaint(aura::Window* window) { |
68 window->SchedulePaintInRect(gfx::Rect(window->bounds().size())); | 67 window->SchedulePaintInRect(gfx::Rect(window->bounds().size())); |
69 } | 68 } |
70 | 69 |
71 } // namespace | 70 } // namespace |
72 | 71 |
73 | 72 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 UpdateSoloWindow(NULL); | 200 UpdateSoloWindow(NULL); |
202 } | 201 } |
203 | 202 |
204 void SoloWindowTracker::OnDockBoundsChanging(const gfx::Rect& new_bounds, | 203 void SoloWindowTracker::OnDockBoundsChanging(const gfx::Rect& new_bounds, |
205 Reason reason) { | 204 Reason reason) { |
206 dock_bounds_ = new_bounds; | 205 dock_bounds_ = new_bounds; |
207 UpdateSoloWindow(NULL); | 206 UpdateSoloWindow(NULL); |
208 } | 207 } |
209 | 208 |
210 } // namespace ash | 209 } // namespace ash |
OLD | NEW |