chromium/ui/views/test/widget_test_aura.cc

// Copyright 2014 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/views/test/widget_test.h"

#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/test/aura_test_helper.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_tree_host.h"
#include "ui/compositor/layer.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/core/shadow_controller.h"

#if BUILDFLAG(ENABLE_DESKTOP_AURA)
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h"
#endif

namespace views::test {

namespace {

// Perform a pre-order traversal of |children| and all descendants, looking for
// |first| and |second|. If |first| is found before |second|, return true.
// When a layer is found, it is set to null. Returns once |second| is found, or
// when there are no children left.
// Note that ui::Layer children are bottom-to-top stacking order.
bool FindLayersInOrder(
    const std::vector<raw_ptr<ui::Layer, VectorExperimental>>& children,
    const ui::Layer** first,
    const ui::Layer** second) {}

#if BUILDFLAG(IS_WIN)

struct FindAllWindowsData {
  // This field is not a raw_ptr<> because it was filtered by the rewriter for:
  // #reinterpret-cast-trivial-type
  RAW_PTR_EXCLUSION std::vector<aura::Window*>* windows;
};

BOOL CALLBACK FindAllWindowsCallback(HWND hwnd, LPARAM param) {
  FindAllWindowsData* data = reinterpret_cast<FindAllWindowsData*>(param);
  if (aura::WindowTreeHost* host =
          aura::WindowTreeHost::GetForAcceleratedWidget(hwnd))
    data->windows->push_back(host->window());
  return TRUE;
}

#endif  // BUILDFLAG(IS_WIN)

std::vector<aura::Window*> GetAllTopLevelWindows() {}

}  // namespace

// static
void WidgetTest::SimulateNativeActivate(Widget* widget) {}

// static
bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) {}

// static
bool WidgetTest::IsWindowStackedAbove(Widget* above, Widget* below) {}

gfx::Size WidgetTest::GetNativeWidgetMinimumContentSize(Widget* widget) {}

// static
ui::EventSink* WidgetTest::GetEventSink(Widget* widget) {}

// static
ui::ImeKeyEventDispatcher* WidgetTest::GetImeKeyEventDispatcherForWidget(
    Widget* widget) {}

// static
bool WidgetTest::IsNativeWindowTransparent(gfx::NativeWindow window) {}

// static
bool WidgetTest::WidgetHasInProcessShadow(Widget* widget) {}

// static
Widget::Widgets WidgetTest::GetAllWidgets() {}

// static
void WidgetTest::WaitForSystemAppActivation() {}

}  // namespace views::test