Chromium Code Reviews| Index: chrome/browser/chromeos/login/test/app_window_waiter.h |
| diff --git a/chrome/browser/chromeos/login/test/app_window_waiter.h b/chrome/browser/chromeos/login/test/app_window_waiter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef5faa8e11f8c2f77809c0723c8b4c72778b0557 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/login/test/app_window_waiter.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ |
| + |
| +#include <string> |
| + |
| +#include "apps/app_window_registry.h" |
| +#include "base/compiler_specific.h" |
| + |
| +namespace apps { |
| +class AppWindow; |
| +} |
| + |
| +namespace content { |
| +class MessageLoopRunner; |
| +} |
| + |
| +namespace chromeos { |
| + |
| +// Helper class that monitors app windows to wait for a window to appear. |
| +class AppWindowWaiter : public apps::AppWindowRegistry::Observer { |
| + public: |
| + AppWindowWaiter(apps::AppWindowRegistry* registry, |
| + const std::string& app_id); |
| + virtual ~AppWindowWaiter(); |
| + |
| + apps::AppWindow* Wait(); |
| + |
| + // AppWindowRegistry::Observer |
|
bartfab (slow)
2014/03/25 12:52:54
Nit: Add a colon at the end.
rkc
2014/03/26 21:30:40
Done.
|
| + virtual void OnAppWindowAdded(apps::AppWindow* app_window) OVERRIDE; |
| + virtual void OnAppWindowIconChanged(apps::AppWindow* app_window) OVERRIDE; |
| + virtual void OnAppWindowRemoved(apps::AppWindow* app_window) OVERRIDE; |
| + |
| + private: |
| + apps::AppWindowRegistry* registry_; |
| + std::string app_id_; |
| + scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
|
bartfab (slow)
2014/03/25 12:52:54
1) New code should use base::RunLoop instead.
2) N
rkc
2014/03/26 21:30:40
Done.
|
| + apps::AppWindow* window_; |
| + bool running_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AppWindowWaiter); |
|
bartfab (slow)
2014/03/25 12:52:54
Nit: #include "base/basictypes.h"
rkc
2014/03/26 21:30:40
Done.
|
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_APP_WINDOW_WAITER_H_ |