#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/basictypes.h"
#include "base/compiler_specific.h"
#include "base/run_loop.h"
namespace apps {
class AppWindow;
}
namespace chromeos {
class AppWindowWaiter : public apps::AppWindowRegistry::Observer {
public:
AppWindowWaiter(apps::AppWindowRegistry* registry,
const std::string& app_id);
virtual ~AppWindowWaiter();
apps::AppWindow* Wait();
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_;
base::RunLoop run_loop_;
apps::AppWindow* window_;
DISALLOW_COPY_AND_ASSIGN(AppWindowWaiter);
};
}
#endif