blob: c0097b747421ed7457aa43557d6304dd136dc674 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/wm/window_preview_view_test_api.h"
#include "ash/wm/window_preview_view.h"
#include "ui/views/widget/widget.h"
namespace ash {
namespace wm {
WindowPreviewViewTestApi::WindowPreviewViewTestApi(
WindowPreviewView* preview_view)
: preview_view_(preview_view) {
DCHECK(preview_view);
}
WindowPreviewViewTestApi::~WindowPreviewViewTestApi() = default;
gfx::RectF WindowPreviewViewTestApi::GetUnionRect() const {
return preview_view_->GetUnionRect();
}
const base::flat_map<aura::Window*, WindowMirrorView*>&
WindowPreviewViewTestApi::GetMirrorViews() const {
return preview_view_->mirror_views_;
}
wm::WindowMirrorView* WindowPreviewViewTestApi::GetMirrorViewForWidget(
views::Widget* widget) {
auto it = preview_view_->mirror_views_.find(widget->GetNativeWindow());
if (it != preview_view_->mirror_views_.end())
return it->second;
return nullptr;
}
} // namespace wm
} // namespace ash