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

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

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/controls/webview/web_dialog_view.cc ('k') | ui/views/test/widget_test.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 #ifndef UI_VIEWS_TEST_WIDGET_TEST_H_ 5 #ifndef UI_VIEWS_TEST_WIDGET_TEST_H_
6 #define UI_VIEWS_TEST_WIDGET_TEST_H_ 6 #define UI_VIEWS_TEST_WIDGET_TEST_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); 177 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter);
178 }; 178 };
179 179
180 // Use in tests to provide functionality to observe the widget passed in the 180 // Use in tests to provide functionality to observe the widget passed in the
181 // constructor for the widget closing event. 181 // constructor for the widget closing event.
182 class WidgetClosingObserver : public WidgetObserver { 182 class WidgetClosingObserver : public WidgetObserver {
183 public: 183 public:
184 explicit WidgetClosingObserver(Widget* widget); 184 explicit WidgetClosingObserver(Widget* widget);
185 ~WidgetClosingObserver() override; 185 ~WidgetClosingObserver() override;
186 186
187 // Returns immediately when |widget_| becomes NULL, otherwise a RunLoop is
188 // used until widget closing event is received.
189 void Wait();
190
187 bool widget_closed() const { return !widget_; } 191 bool widget_closed() const { return !widget_; }
188 192
189 private: 193 private:
190 // views::WidgetObserver override: 194 // views::WidgetObserver override:
191 void OnWidgetClosing(Widget* widget) override; 195 void OnWidgetClosing(Widget* widget) override;
192 196
193 Widget* widget_; 197 Widget* widget_;
198 base::RunLoop run_loop_;
194 199
195 DISALLOW_COPY_AND_ASSIGN(WidgetClosingObserver); 200 DISALLOW_COPY_AND_ASSIGN(WidgetClosingObserver);
196 }; 201 };
197 202
198 } // namespace test 203 } // namespace test
199 } // namespace views 204 } // namespace views
200 205
201 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ 206 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_
OLDNEW
« no previous file with comments | « ui/views/controls/webview/web_dialog_view.cc ('k') | ui/views/test/widget_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698