Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "apps/app_window_registry.h" | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/run_loop.h" | |
| 13 | |
| 14 namespace apps { | |
| 15 class AppWindow; | |
| 16 } | |
| 17 | |
| 18 namespace content { | |
| 19 class MessageLoopRunner; | |
|
xiyuan
2014/03/26 21:58:19
nit: This can be removed now.
rkc
2014/03/26 22:26:12
Done.
| |
| 20 } | |
| 21 | |
| 22 namespace chromeos { | |
| 23 | |
| 24 // Helper class that monitors app windows to wait for a window to appear. | |
| 25 class AppWindowWaiter : public apps::AppWindowRegistry::Observer { | |
| 26 public: | |
| 27 AppWindowWaiter(apps::AppWindowRegistry* registry, | |
| 28 const std::string& app_id); | |
| 29 virtual ~AppWindowWaiter(); | |
| 30 | |
| 31 apps::AppWindow* Wait(); | |
| 32 | |
| 33 // AppWindowRegistry::Observer: | |
| 34 virtual void OnAppWindowAdded(apps::AppWindow* app_window) OVERRIDE; | |
| 35 virtual void OnAppWindowIconChanged(apps::AppWindow* app_window) OVERRIDE; | |
| 36 virtual void OnAppWindowRemoved(apps::AppWindow* app_window) OVERRIDE; | |
| 37 | |
| 38 private: | |
| 39 apps::AppWindowRegistry* registry_; | |
| 40 std::string app_id_; | |
| 41 base::RunLoop run_loop_; | |
| 42 apps::AppWindow* window_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(AppWindowWaiter); | |
| 45 }; | |
| 46 | |
| 47 } // namespace chromeos | |
| 48 | |
| 49 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ | |
| OLD | NEW |