#ifndef ASH_TEST_TEST_ACTIVATION_DELEGATE_H_
#define ASH_TEST_TEST_ACTIVATION_DELEGATE_H_
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "ui/events/event_handler.h"
#include "ui/wm/public/activation_change_observer.h"
#include "ui/wm/public/activation_delegate.h"
namespace aura {
class Window;
}
namespace ash {
namespace test {
class TestActivationDelegate : public aura::client::ActivationDelegate,
public aura::client::ActivationChangeObserver {
public:
TestActivationDelegate();
explicit TestActivationDelegate(bool activate);
void SetWindow(aura::Window* window);
bool window_was_active() const { return window_was_active_; }
void set_activate(bool v) { activate_ = v; }
int activated_count() const { return activated_count_; }
int lost_active_count() const { return lost_active_count_; }
int should_activate_count() const { return should_activate_count_; }
void Clear() {
activated_count_ = lost_active_count_ = should_activate_count_ = 0;
window_was_active_ = false;
}
virtual bool ShouldActivate() const OVERRIDE;
private:
virtual void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) OVERRIDE;
aura::Window* window_;
bool window_was_active_;
bool activate_;
int activated_count_;
int lost_active_count_;
mutable int should_activate_count_;
DISALLOW_COPY_AND_ASSIGN(TestActivationDelegate);
};
}
}
#endif