#ifndef UI_WM_CORE_SHADOW_CONTROLLER_H_
#define UI_WM_CORE_SHADOW_CONTROLLER_H_
#include <map>
#include <memory>
#include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "ui/compositor_extra/shadow.h"
#include "ui/wm/public/activation_change_observer.h"
namespace aura {
class Env;
class Window;
}
namespace ui {
class ColorProvider;
class Shadow;
}
namespace wm {
class ActivationClient;
class ShadowControllerDelegate;
class COMPONENT_EXPORT(UI_WM) ShadowController
: public ActivationChangeObserver {
public:
static ui::Shadow* GetShadowForWindow(aura::Window* window);
static ui::Shadow::ElevationToColorsMap GenerateShadowColorsMap(
const ui::ColorProvider* color_provider);
ShadowController(ActivationClient* activation_client,
std::unique_ptr<ShadowControllerDelegate> delegate,
aura::Env* env = nullptr);
ShadowController(const ShadowController&) = delete;
ShadowController& operator=(const ShadowController&) = delete;
~ShadowController() override;
bool IsShadowVisibleForWindow(aura::Window* window);
void UpdateShadowForWindow(aura::Window* window);
void OnWindowActivated(ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) override;
bool IsObservingWindowForTest(aura::Window* window) const;
private:
class Impl;
raw_ptr<ActivationClient> activation_client_;
scoped_refptr<Impl> impl_;
};
}
#endif