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

Side by Side Diff: chrome/browser/ui/panels/test_panel_notification_observer.h

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_PANELS_TEST_PANEL_NOTIFICATION_OBSERVER_H_
6 #define CHROME_BROWSER_UI_PANELS_TEST_PANEL_NOTIFICATION_OBSERVER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
12
13 namespace content {
14 class MessageLoopRunner;
15 class NotificationSource;
16 }
17
18 // Common base class for a custom notification observer that waits
19 // on a notification until an expected state is achieved.
20 // Modeled after ui_test_utils notification observers, but can handle
21 // more than one occurrence of the notification.
22 class TestPanelNotificationObserver : public content::NotificationObserver {
23 public:
24 TestPanelNotificationObserver(int notification,
25 const content::NotificationSource& source);
26 ~TestPanelNotificationObserver() override;
27
28 // Wait until the expected state is achieved.
29 void Wait();
30
31 // content::NotificationObserver:
32 void Observe(int type,
33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) override;
35
36 protected:
37 virtual bool AtExpectedState() = 0;
38
39 bool seen_; // true after transition to expected state has been seen
40 bool running_; // indicates whether message loop is running
41 content::NotificationRegistrar registrar_;
42 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
43
44 DISALLOW_COPY_AND_ASSIGN(TestPanelNotificationObserver);
45 };
46
47 #endif // CHROME_BROWSER_UI_PANELS_TEST_PANEL_NOTIFICATION_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/test_panel_mouse_watcher.cc ('k') | chrome/browser/ui/panels/test_panel_notification_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698