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

Side by Side Diff: ui/views/test/widget_test.cc

Issue 2871073002: cros: Bind hangup red button on remote controller to close web dialog (Closed)
Patch Set: nits Created 3 years, 7 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 | « ui/views/test/widget_test.h ('k') | ui/web_dialogs/web_dialog_delegate.h » ('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 "ui/views/test/widget_test.h" 5 #include "ui/views/test/widget_test.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ui/gfx/native_widget_types.h" 8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/views/test/native_widget_factory.h" 9 #include "ui/views/test/native_widget_factory.h"
10 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 WidgetClosingObserver::WidgetClosingObserver(Widget* widget) : widget_(widget) { 180 WidgetClosingObserver::WidgetClosingObserver(Widget* widget) : widget_(widget) {
181 widget_->AddObserver(this); 181 widget_->AddObserver(this);
182 } 182 }
183 183
184 WidgetClosingObserver::~WidgetClosingObserver() { 184 WidgetClosingObserver::~WidgetClosingObserver() {
185 if (widget_) 185 if (widget_)
186 widget_->RemoveObserver(this); 186 widget_->RemoveObserver(this);
187 } 187 }
188 188
189 void WidgetClosingObserver::Wait() {
190 if (widget_)
191 run_loop_.Run();
192 }
193
189 void WidgetClosingObserver::OnWidgetClosing(Widget* widget) { 194 void WidgetClosingObserver::OnWidgetClosing(Widget* widget) {
190 DCHECK_EQ(widget_, widget); 195 DCHECK_EQ(widget_, widget);
191 widget_->RemoveObserver(this); 196 widget_->RemoveObserver(this);
192 widget_ = nullptr; 197 widget_ = nullptr;
198 if (run_loop_.running())
199 run_loop_.Quit();
193 } 200 }
194 201
195 } // namespace test 202 } // namespace test
196 } // namespace views 203 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/widget_test.h ('k') | ui/web_dialogs/web_dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698