#include "ui/wm/core/shadow_controller.h"
#include <utility>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/scoped_multi_source_observation.h"
#include "build/chromeos_buildflags.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/env_observer.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/base/class_property.h"
#include "ui/base/ui_base_types.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/compositor/layer.h"
#include "ui/wm/core/shadow_controller_delegate.h"
#include "ui/wm/core/shadow_types.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_client.h"
make_pair;
DEFINE_UI_CLASS_PROPERTY_TYPE(…)
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(…)
namespace wm {
namespace {
int GetShadowElevationForActiveState(aura::Window* window) { … }
int GetShadowElevationForWindowLosingActive(aura::Window* losing_active,
aura::Window* gaining_active) { … }
}
class ShadowController::Impl :
public aura::EnvObserver,
public aura::WindowObserver,
public base::RefCounted<Impl> { … };
ShadowController::Impl* ShadowController::Impl::GetInstance(aura::Env* env) { … }
bool ShadowController::Impl::IsShadowVisibleForWindow(aura::Window* window) { … }
void ShadowController::Impl::UpdateShadowForWindow(aura::Window* window) { … }
void ShadowController::Impl::OnWindowInitialized(aura::Window* window) { … }
void ShadowController::Impl::OnWindowParentChanged(aura::Window* window,
aura::Window* parent) { … }
void ShadowController::Impl::OnWindowPropertyChanged(aura::Window* window,
const void* key,
intptr_t old) { … }
void ShadowController::Impl::OnWindowVisibilityChanging(aura::Window* window,
bool visible) { … }
void ShadowController::Impl::OnWindowBoundsChanged(
aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) { … }
void ShadowController::Impl::OnWindowDestroyed(aura::Window* window) { … }
void ShadowController::Impl::OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) { … }
bool ShadowController::Impl::ShouldShowShadowForWindow(
aura::Window* window) const { … }
void ShadowController::Impl::MaybeSetShadowRadiusForWindow(
aura::Window* window) const { … }
void ShadowController::Impl::HandlePossibleShadowVisibilityChange(
aura::Window* window) { … }
void ShadowController::Impl::CreateShadowForWindow(aura::Window* window) { … }
ShadowController::Impl::Impl(aura::Env* env)
: … { … }
ShadowController::Impl::~Impl() { … }
base::flat_set<ShadowController::Impl*>*
ShadowController::Impl::GetInstances() { … }
ui::Shadow* ShadowController::GetShadowForWindow(aura::Window* window) { … }
ui::Shadow::ElevationToColorsMap ShadowController::GenerateShadowColorsMap(
const ui::ColorProvider* color_provider) { … }
ShadowController::ShadowController(
ActivationClient* activation_client,
std::unique_ptr<ShadowControllerDelegate> delegate,
aura::Env* env)
: … { … }
ShadowController::~ShadowController() { … }
bool ShadowController::IsShadowVisibleForWindow(aura::Window* window) { … }
void ShadowController::UpdateShadowForWindow(aura::Window* window) { … }
void ShadowController::OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) { … }
}