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/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/system_modal_container_event_filter.h" | 10 #include "ash/wm/system_modal_container_event_filter.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 void SystemModalContainerLayoutManager::OnWindowResized() { | 73 void SystemModalContainerLayoutManager::OnWindowResized() { |
74 if (modal_background_) { | 74 if (modal_background_) { |
75 // Note: we have to set the entire bounds with the screen offset. | 75 // Note: we have to set the entire bounds with the screen offset. |
76 modal_background_->SetBounds( | 76 modal_background_->SetBounds( |
77 Shell::GetScreen()->GetDisplayNearestWindow(container_).bounds()); | 77 Shell::GetScreen()->GetDisplayNearestWindow(container_).bounds()); |
78 } | 78 } |
79 if (!modal_windows_.empty()) { | 79 if (!modal_windows_.empty()) { |
80 aura::Window::Windows::iterator it = modal_windows_.begin(); | 80 aura::Window::Windows::iterator it = modal_windows_.begin(); |
81 for (it = modal_windows_.begin(); it != modal_windows_.end(); ++it) { | 81 for (it = modal_windows_.begin(); it != modal_windows_.end(); ++it) { |
82 (*it)->SetBounds((*it)->bounds().AdjustToFit(container_->bounds())); | 82 gfx::Rect bounds = (*it)->bounds(); |
| 83 bounds.AdjustToFit(container_->bounds()); |
| 84 (*it)->SetBounds(bounds); |
83 } | 85 } |
84 } | 86 } |
85 } | 87 } |
86 | 88 |
87 void SystemModalContainerLayoutManager::OnWindowAddedToLayout( | 89 void SystemModalContainerLayoutManager::OnWindowAddedToLayout( |
88 aura::Window* child) { | 90 aura::Window* child) { |
89 DCHECK((modal_background_ && child == modal_background_->GetNativeView()) || | 91 DCHECK((modal_background_ && child == modal_background_->GetNativeView()) || |
90 child->type() == aura::client::WINDOW_TYPE_NORMAL || | 92 child->type() == aura::client::WINDOW_TYPE_NORMAL || |
91 child->type() == aura::client::WINDOW_TYPE_POPUP); | 93 child->type() == aura::client::WINDOW_TYPE_POPUP); |
92 child->AddObserver(this); | 94 child->AddObserver(this); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 aura::Window::Windows::iterator it = | 230 aura::Window::Windows::iterator it = |
229 std::find(modal_windows_.begin(), modal_windows_.end(), window); | 231 std::find(modal_windows_.begin(), modal_windows_.end(), window); |
230 if (it != modal_windows_.end()) | 232 if (it != modal_windows_.end()) |
231 modal_windows_.erase(it); | 233 modal_windows_.erase(it); |
232 | 234 |
233 Shell::GetInstance()->OnModalWindowRemoved(window); | 235 Shell::GetInstance()->OnModalWindowRemoved(window); |
234 } | 236 } |
235 | 237 |
236 } // namespace internal | 238 } // namespace internal |
237 } // namespace ash | 239 } // namespace ash |
OLD | NEW |