Chromium Code Reviews| Index: chrome/browser/ui/views/overlay/overlay_window_views.cc |
| diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d8d12e8010bcfe0e6a619b2a0ecf2615d0e8cc44 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc |
| @@ -0,0 +1,126 @@ |
| +// Copyright 2017 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 "chrome/browser/ui/views/overlay/overlay_window_views.h" |
| + |
| +// static |
| +std::unique_ptr<OverlayWindow> OverlayWindow::Create() { |
| + return base::WrapUnique(new OverlayWindowViews()); |
| +} |
| + |
| +OverlayWindowViews::OverlayWindowViews() { |
| + widget_.reset(new views::Widget()); |
| +} |
| + |
| +OverlayWindowViews::~OverlayWindowViews() = default; |
| + |
| +void OverlayWindowViews::Init() { |
| + // TODO(apacible): Finalize the type of widget. |
| + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| + |
| + // TODO(apacible): Update preferred sizing and positioning. |
| + params.bounds = gfx::Rect(200, 200, 700, 500); |
| + params.keep_on_top = true; |
| + params.visible_on_all_workspaces = true; |
| + |
| + widget_->Init(params); |
| + widget_->Show(); |
| + |
| + // TODO(apacible): Set the WidgetDelegate for more control over behavior. |
|
mlamouri (slow - plz ping)
2017/06/27 18:35:47
Maybe open bugs and link to them?
apacible
2017/06/30 04:56:59
Updated general window bug (crbug/726621) with CL
|
| +} |
| + |
| +ui::Layer* OverlayWindowViews::GetLayer() { |
| + return widget_->GetLayer(); |
| +} |
| + |
| +bool OverlayWindowViews::IsActive() const { |
| + return widget_->IsActive(); |
| +} |
| + |
| +// Window is never maximized. |
| +bool OverlayWindowViews::IsMaximized() const { |
| + return false; |
| +} |
| + |
| +// Window is never minimized. |
| +bool OverlayWindowViews::IsMinimized() const { |
| + return false; |
| +} |
| + |
| +// Window is never fullscreened. |
| +bool OverlayWindowViews::IsFullscreen() const { |
| + return false; |
| +} |
| + |
| +gfx::NativeWindow OverlayWindowViews::GetNativeWindow() const { |
| + return widget_->GetNativeWindow(); |
| +} |
| + |
| +gfx::Rect OverlayWindowViews::GetRestoredBounds() const { |
| + return GetBounds(); |
| +} |
| + |
| +// Returns the restore state for the window (platform dependent). |
| +ui::WindowShowState OverlayWindowViews::GetRestoredState() const { |
| + return ui::SHOW_STATE_NORMAL; |
| +} |
| + |
| +// Retrieves the window's current bounds, including its window. |
| +// This will only differ from GetRestoredBounds() for maximized |
| +// and minimized windows. |
| +gfx::Rect OverlayWindowViews::GetBounds() const { |
| + return widget_->GetRestoredBounds(); |
| +} |
| + |
| +void OverlayWindowViews::Show() { |
| + widget_->Show(); |
| +} |
| + |
| +void OverlayWindowViews::Hide() { |
| + widget_->Hide(); |
| +} |
| + |
| +void OverlayWindowViews::ShowInactive() { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::Close() { |
| + widget_->Close(); |
| +} |
| + |
| +void OverlayWindowViews::Activate() { |
| + widget_->Activate(); |
| +} |
| + |
| +void OverlayWindowViews::Deactivate() { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::Maximize() { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::Minimize() { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::Restore() { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::SetBounds(const gfx::Rect& bounds) { |
| + NOTREACHED(); |
| +} |
| + |
| +void OverlayWindowViews::FlashFrame(bool flash) { |
| + NOTREACHED(); |
| +} |
| + |
| +bool OverlayWindowViews::IsAlwaysOnTop() const { |
| + return true; |
| +} |
| + |
| +void OverlayWindowViews::SetAlwaysOnTop(bool always_on_top) { |
| + NOTREACHED(); |
| +} |