Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: ash/wm/system_modal_container_layout_manager.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/shelf_layout_manager.cc ('k') | ash/wm/window_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698