chromium/ui/aura/env.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/aura/env.h"

#include <vector>

#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "base/observer_list_types.h"
#include "build/build_config.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env_input_state_controller.h"
#include "ui/aura/env_observer.h"
#include "ui/aura/input_state_lookup.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher_observer.h"
#include "ui/aura/window_occlusion_tracker.h"
#include "ui/display/screen.h"
#include "ui/events/event_observer.h"
#include "ui/events/event_target_iterator.h"
#include "ui/events/gestures/gesture_recognizer_impl.h"
#include "ui/events/platform/platform_event_source.h"

#if BUILDFLAG(IS_WIN)
#include "ui/base/win/win_cursor_factory.h"
#endif

#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif

namespace aura {

namespace {

// Instance created by all static functions, except
// CreateLocalInstanceForInProcess(). See GetInstance() for details.
Env* g_primary_instance =;

}  // namespace

// EventObserverAdapter is an aura::Env pre-target handler that forwards
// read-only events to its observer when they match the requested types.
class EventObserverAdapter : public ui::EventHandler,
                             public base::CheckedObserver {};

////////////////////////////////////////////////////////////////////////////////
// Env, public:

Env::~Env() {}

// static
std::unique_ptr<Env> Env::CreateInstance() {}

// static
Env* Env::GetInstance() {}

// static
bool Env::HasInstance() {}

void Env::AddObserver(EnvObserver* observer) {}

void Env::RemoveObserver(EnvObserver* observer) {}

void Env::AddWindowEventDispatcherObserver(
    WindowEventDispatcherObserver* observer) {}

void Env::RemoveWindowEventDispatcherObserver(
    WindowEventDispatcherObserver* observer) {}

bool Env::IsMouseButtonDown() const {}

void Env::SetLastMouseLocation(const gfx::Point& last_mouse_location) {}

void Env::SetLastTouchLocation(const aura::Window* target,
                               const gfx::Point& last_touch_location) {}

void Env::SetTouchDown(bool is_touch_down) {}

void Env::SetGestureRecognizer(
    std::unique_ptr<ui::GestureRecognizer> gesture_recognizer) {}

gfx::Point Env::GetLastPointerPoint(ui::mojom::DragEventSource event_source,
                                    Window* window,
                                    std::optional<gfx::Point> fallback) {}

WindowOcclusionTracker* Env::GetWindowOcclusionTracker() {}

void Env::PauseWindowOcclusionTracking() {}

void Env::UnpauseWindowOcclusionTracking() {}

void Env::AddEventObserver(ui::EventObserver* observer,
                           ui::EventTarget* target,
                           const std::set<ui::EventType>& types) {}

void Env::RemoveEventObserver(ui::EventObserver* observer) {}

void Env::NotifyEventObservers(const ui::Event& event) {}

////////////////////////////////////////////////////////////////////////////////
// Env, private:

// static
bool Env::initial_throttle_input_on_resize_ =;

Env::Env()
    :{}

bool Env::Init() {}

void Env::NotifyWindowInitialized(Window* window) {}

void Env::NotifyHostInitialized(WindowTreeHost* host) {}

void Env::NotifyHostDestroyed(WindowTreeHost* host) {}

////////////////////////////////////////////////////////////////////////////////
// Env, ui::EventTarget implementation:

bool Env::CanAcceptEvent(const ui::Event& event) {}

ui::EventTarget* Env::GetParentTarget() {}

std::unique_ptr<ui::EventTargetIterator> Env::GetChildIterator() const {}

ui::EventTargeter* Env::GetEventTargeter() {}

}  // namespace aura