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

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

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cc Created 7 years 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 | Annotate | Revision Log
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/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/session_state_delegate.h" 8 #include "ash/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 class TransientWindowObserver : public aura::WindowObserver { 121 class TransientWindowObserver : public aura::WindowObserver {
122 public: 122 public:
123 TransientWindowObserver() : destroyed_(false) {} 123 TransientWindowObserver() : destroyed_(false) {}
124 virtual ~TransientWindowObserver() {} 124 virtual ~TransientWindowObserver() {}
125 125
126 bool destroyed() const { return destroyed_; } 126 bool destroyed() const { return destroyed_; }
127 127
128 // Overridden from aura::WindowObserver: 128 // Overridden from aura::WindowObserver:
129 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE { 129 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {
130 destroyed_ = true; 130 destroyed_ = true;
131 aura::WindowObserver::OnWindowDestroyed(window);
131 } 132 }
132 133
133 private: 134 private:
134 bool destroyed_; 135 bool destroyed_;
135 136
136 DISALLOW_COPY_AND_ASSIGN(TransientWindowObserver); 137 DISALLOW_COPY_AND_ASSIGN(TransientWindowObserver);
137 }; 138 };
138 139
139 } // namespace 140 } // namespace
140 141
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 487
487 // No more modal screen. 488 // No more modal screen.
488 modal1->Hide(); 489 modal1->Hide();
489 TestWindow::CloseTestWindow(modal1.release()); 490 TestWindow::CloseTestWindow(modal1.release());
490 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds()); 491 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds());
491 EXPECT_TRUE(wm::IsActiveWindow(normal.get())); 492 EXPECT_TRUE(wm::IsActiveWindow(normal.get()));
492 } 493 }
493 494
494 } // namespace test 495 } // namespace test
495 } // namespace ash 496 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698