Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/browser/ui/views/overlay/overlay_window_views.cc

Issue 2905833004: [OverlayWindow] Add platform-independent window and views implementation. (Closed)
Patch Set: Changes per sky@'s comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/overlay/overlay_window_views.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/overlay/overlay_window_views.h"
6
7 // static
8 std::unique_ptr<OverlayWindow> OverlayWindow::Create() {
9 return base::WrapUnique(new OverlayWindowViews());
10 }
11
12 OverlayWindowViews::OverlayWindowViews() {
13 widget_.reset(new views::Widget());
14 }
15
16 OverlayWindowViews::~OverlayWindowViews() = default;
17
18 void OverlayWindowViews::Init() {
19 // TODO(apacible): Finalize the type of widget.
20 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
21
22 // TODO(apacible): Update preferred sizing and positioning.
23 params.bounds = gfx::Rect(200, 200, 700, 500);
24 params.keep_on_top = true;
25 params.visible_on_all_workspaces = true;
26
27 widget_->Init(params);
28 widget_->Show();
29
30 // 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
31 }
32
33 ui::Layer* OverlayWindowViews::GetLayer() {
34 return widget_->GetLayer();
35 }
36
37 bool OverlayWindowViews::IsActive() const {
38 return widget_->IsActive();
39 }
40
41 // Window is never maximized.
42 bool OverlayWindowViews::IsMaximized() const {
43 return false;
44 }
45
46 // Window is never minimized.
47 bool OverlayWindowViews::IsMinimized() const {
48 return false;
49 }
50
51 // Window is never fullscreened.
52 bool OverlayWindowViews::IsFullscreen() const {
53 return false;
54 }
55
56 gfx::NativeWindow OverlayWindowViews::GetNativeWindow() const {
57 return widget_->GetNativeWindow();
58 }
59
60 gfx::Rect OverlayWindowViews::GetRestoredBounds() const {
61 return GetBounds();
62 }
63
64 // Returns the restore state for the window (platform dependent).
65 ui::WindowShowState OverlayWindowViews::GetRestoredState() const {
66 return ui::SHOW_STATE_NORMAL;
67 }
68
69 // Retrieves the window's current bounds, including its window.
70 // This will only differ from GetRestoredBounds() for maximized
71 // and minimized windows.
72 gfx::Rect OverlayWindowViews::GetBounds() const {
73 return widget_->GetRestoredBounds();
74 }
75
76 void OverlayWindowViews::Show() {
77 widget_->Show();
78 }
79
80 void OverlayWindowViews::Hide() {
81 widget_->Hide();
82 }
83
84 void OverlayWindowViews::ShowInactive() {
85 NOTREACHED();
86 }
87
88 void OverlayWindowViews::Close() {
89 widget_->Close();
90 }
91
92 void OverlayWindowViews::Activate() {
93 widget_->Activate();
94 }
95
96 void OverlayWindowViews::Deactivate() {
97 NOTREACHED();
98 }
99
100 void OverlayWindowViews::Maximize() {
101 NOTREACHED();
102 }
103
104 void OverlayWindowViews::Minimize() {
105 NOTREACHED();
106 }
107
108 void OverlayWindowViews::Restore() {
109 NOTREACHED();
110 }
111
112 void OverlayWindowViews::SetBounds(const gfx::Rect& bounds) {
113 NOTREACHED();
114 }
115
116 void OverlayWindowViews::FlashFrame(bool flash) {
117 NOTREACHED();
118 }
119
120 bool OverlayWindowViews::IsAlwaysOnTop() const {
121 return true;
122 }
123
124 void OverlayWindowViews::SetAlwaysOnTop(bool always_on_top) {
125 NOTREACHED();
126 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/overlay/overlay_window_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698