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

Side by Side Diff: ash/common/wm/window_state.cc

Issue 2414303002: Remove usage of FOR_EACH_OBSERVER macro in ash/common (Closed)
Patch Set: Created 4 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/common/wm/dock/docked_window_layout_manager.cc ('k') | ash/common/wm_shell.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 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/common/wm/window_state.h" 5 #include "ash/common/wm/window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/wm/default_state.h" 9 #include "ash/common/wm/default_state.h"
10 #include "ash/common/wm/window_positioning_utils.h" 10 #include "ash/common/wm/window_positioning_utils.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 ui::WindowShowState new_window_state = 344 ui::WindowShowState new_window_state =
345 ToWindowShowState(current_state_->GetType()); 345 ToWindowShowState(current_state_->GetType());
346 if (new_window_state != GetShowState()) { 346 if (new_window_state != GetShowState()) {
347 base::AutoReset<bool> resetter(&ignore_property_change_, true); 347 base::AutoReset<bool> resetter(&ignore_property_change_, true);
348 window_->SetShowState(new_window_state); 348 window_->SetShowState(new_window_state);
349 } 349 }
350 } 350 }
351 351
352 void WindowState::NotifyPreStateTypeChange( 352 void WindowState::NotifyPreStateTypeChange(
353 WindowStateType old_window_state_type) { 353 WindowStateType old_window_state_type) {
354 FOR_EACH_OBSERVER(WindowStateObserver, observer_list_, 354 for (auto& observer : observer_list_)
355 OnPreWindowStateTypeChange(this, old_window_state_type)); 355 observer.OnPreWindowStateTypeChange(this, old_window_state_type);
356 } 356 }
357 357
358 void WindowState::NotifyPostStateTypeChange( 358 void WindowState::NotifyPostStateTypeChange(
359 WindowStateType old_window_state_type) { 359 WindowStateType old_window_state_type) {
360 FOR_EACH_OBSERVER(WindowStateObserver, observer_list_, 360 for (auto& observer : observer_list_)
361 OnPostWindowStateTypeChange(this, old_window_state_type)); 361 observer.OnPostWindowStateTypeChange(this, old_window_state_type);
362 } 362 }
363 363
364 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) { 364 void WindowState::SetBoundsDirect(const gfx::Rect& bounds) {
365 gfx::Rect actual_new_bounds(bounds); 365 gfx::Rect actual_new_bounds(bounds);
366 // Ensure we don't go smaller than our minimum bounds in "normal" window 366 // Ensure we don't go smaller than our minimum bounds in "normal" window
367 // modes 367 // modes
368 if (window_->HasNonClientArea() && !IsMaximized() && !IsFullscreen()) { 368 if (window_->HasNonClientArea() && !IsMaximized() && !IsFullscreen()) {
369 // Get the minimum usable size of the minimum size and the screen size. 369 // Get the minimum usable size of the minimum size and the screen size.
370 gfx::Size min_size = window_->GetMinimumSize(); 370 gfx::Size min_size = window_->GetMinimumSize();
371 min_size.SetToMin(window_->GetDisplayNearestWindow().work_area().size()); 371 min_size.SetToMin(window_->GetDisplayNearestWindow().work_area().size());
(...skipping 24 matching lines...) Expand all
396 if (!window_->GetTargetVisibility()) { 396 if (!window_->GetTargetVisibility()) {
397 SetBoundsConstrained(new_bounds); 397 SetBoundsConstrained(new_bounds);
398 return; 398 return;
399 } 399 }
400 400
401 window_->SetBoundsDirectCrossFade(new_bounds); 401 window_->SetBoundsDirectCrossFade(new_bounds);
402 } 402 }
403 403
404 } // namespace wm 404 } // namespace wm
405 } // namespace ash 405 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/dock/docked_window_layout_manager.cc ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698