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 <vector> | 7 #include <vector> |
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 window->layer() && | 170 window->layer() && |
171 window->layer()->type() != ui::LAYER_NOT_DRAWN && | 171 window->layer()->type() != ui::LAYER_NOT_DRAWN && |
172 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && | 172 window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_NONE && |
173 !window->GetProperty(ash::kConstrainedWindowKey); | 173 !window->GetProperty(ash::kConstrainedWindowKey); |
174 } | 174 } |
175 | 175 |
176 // Returns a list of windows in |root_window|| that potentially could have | 176 // Returns a list of windows in |root_window|| that potentially could have |
177 // a transparent solo-window header. | 177 // a transparent solo-window header. |
178 std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) { | 178 std::vector<Window*> GetWindowsForSoloHeaderUpdate(RootWindow* root_window) { |
179 std::vector<Window*> windows; | 179 std::vector<Window*> windows; |
| 180 // During shutdown there may not be a workspace controller. In that case |
| 181 // we don't care about updating any windows. |
180 // Avoid memory allocations for typical window counts. | 182 // Avoid memory allocations for typical window counts. |
181 windows.reserve(16); | 183 windows.reserve(16); |
182 // Collect windows from the desktop. | 184 // Collect windows from the desktop. |
183 Window* desktop = ash::Shell::GetContainer( | 185 Window* desktop = ash::Shell::GetContainer( |
184 root_window, ash::internal::kShellWindowId_DefaultContainer); | 186 root_window, ash::internal::kShellWindowId_DefaultContainer); |
185 windows.insert(windows.end(), | 187 windows.insert(windows.end(), |
186 desktop->children().begin(), | 188 desktop->children().begin(), |
187 desktop->children().end()); | 189 desktop->children().end()); |
188 // Collect "always on top" windows. | 190 // Collect "always on top" windows. |
189 Window* top_container = | 191 Window* top_container = |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 // icon. Don't use |window_icon_| for this computation as it may be NULL. | 835 // icon. Don't use |window_icon_| for this computation as it may be NULL. |
834 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; | 836 int title_y = GetCaptionButtonContainerCenterY() - title_font.GetHeight() / 2; |
835 return gfx::Rect( | 837 return gfx::Rect( |
836 title_x, | 838 title_x, |
837 std::max(0, title_y), | 839 std::max(0, title_y), |
838 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), | 840 std::max(0, caption_button_container_->x() - kTitleLogoSpacing - title_x), |
839 title_font.GetHeight()); | 841 title_font.GetHeight()); |
840 } | 842 } |
841 | 843 |
842 } // namespace ash | 844 } // namespace ash |
OLD | NEW |