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

Side by Side Diff: ash/mus/bridge/wm_shelf_mus.cc

Issue 2247503002: mash: Create and show a shelf in mash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/mus/bridge/wm_shelf_mus.h" 5 #include "ash/mus/bridge/wm_shelf_mus.h"
6 6
7 #include "ash/common/shelf/shelf_delegate.h"
7 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
8 #include "ash/common/wm_root_window_controller.h" 9 #include "ash/common/wm_root_window_controller.h"
9 #include "ash/mus/bridge/wm_window_mus.h" 10 #include "ash/common/wm_shell.h"
10 #include "services/ui/public/cpp/window.h" 11 #include "ash/common/wm_window.h"
11 #include "ui/views/widget/widget.h" 12 #include "ash/shelf/shelf.h"
12 13 #include "ash/shelf/shelf_widget.h"
13 // TODO(sky): fully implement this http://crbug.com/612631 . 14 #include "base/memory/ptr_util.h"
14 #undef NOTIMPLEMENTED
15 #define NOTIMPLEMENTED() DVLOG(1) << "notimplemented"
16 15
17 namespace ash { 16 namespace ash {
18 namespace mus { 17 namespace mus {
19 18
20 WmShelfMus::WmShelfMus(WmRootWindowController* root_window_controller) { 19 WmShelfMus::WmShelfMus(WmRootWindowController* root_window_controller) {
21 DCHECK(root_window_controller); 20 DCHECK(root_window_controller);
22 // Create a placeholder shelf widget, because the status area code assumes it 21 WmShell::Get()->CreateShelfDelegate();
23 // can access one. 22 WmWindow* root = root_window_controller->GetWindow();
24 // TODO(jamescook): Create a real shelf widget. http://crbug.com/615155 23 shelf_widget_.reset(new ShelfWidget(
25 shelf_widget_ = new views::Widget; 24 root->GetChildByShellWindowId(kShellWindowId_ShelfContainer),
26 views::Widget::InitParams params( 25 root->GetChildByShellWindowId(kShellWindowId_StatusContainer), this));
27 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 26 Shelf* shelf =
28 root_window_controller->ConfigureWidgetInitParamsForContainer( 27 new Shelf(this, shelf_widget_->CreateShelfView(), shelf_widget_.get());
29 shelf_widget_, kShellWindowId_ShelfContainer, &params); 28 shelf_widget_->set_shelf(shelf);
30 shelf_widget_->Init(params); 29 // Must be initialized before the delegate is notified because the delegate
30 // may try to access the WmShelf.
31 SetShelf(base::WrapUnique(shelf));
James Cook 2016/08/16 23:21:35 I know I said something different in person, but n
msw 2016/08/17 01:09:01 Done.
32 WmShell::Get()->shelf_delegate()->OnShelfCreated(shelf);
33 WmShell::Get()->NotifyShelfCreatedForRootWindow(root);
34 shelf_widget_->PostCreateShelf();
31 } 35 }
32 36
33 WmShelfMus::~WmShelfMus() {} 37 WmShelfMus::~WmShelfMus() {}
34 38
35 WmWindow* WmShelfMus::GetWindow() {
36 return WmWindowMus::Get(shelf_widget_);
37 }
38
39 ShelfAlignment WmShelfMus::GetAlignment() const {
40 NOTIMPLEMENTED();
41 return SHELF_ALIGNMENT_BOTTOM;
42 }
43
44 void WmShelfMus::SetAlignment(ShelfAlignment alignment) {
45 NOTIMPLEMENTED();
46 }
47
48 ShelfAutoHideBehavior WmShelfMus::GetAutoHideBehavior() const {
49 NOTIMPLEMENTED();
50 return SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
51 }
52
53 void WmShelfMus::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
54 NOTIMPLEMENTED();
55 }
56
57 ShelfAutoHideState WmShelfMus::GetAutoHideState() const {
58 NOTIMPLEMENTED();
59 return SHELF_AUTO_HIDE_HIDDEN;
60 }
61
62 void WmShelfMus::UpdateAutoHideState() {
63 NOTIMPLEMENTED();
64 }
65
66 ShelfBackgroundType WmShelfMus::GetBackgroundType() const {
67 NOTIMPLEMENTED();
68 return SHELF_BACKGROUND_DEFAULT;
69 }
70
71 WmDimmerView* WmShelfMus::CreateDimmerView(bool disable_animations_for_test) {
72 // mus does not dim shelf items.
73 return nullptr;
74 }
75
76 bool WmShelfMus::IsDimmed() const {
77 // mus does not dim shelf items.
78 return false;
79 }
80
81 void WmShelfMus::SchedulePaint() {
82 NOTIMPLEMENTED();
83 }
84
85 bool WmShelfMus::IsVisible() const {
86 NOTIMPLEMENTED();
87 return true;
88 }
89
90 void WmShelfMus::UpdateVisibilityState() {
91 NOTIMPLEMENTED();
92 }
93
94 ShelfVisibilityState WmShelfMus::GetVisibilityState() const {
95 NOTIMPLEMENTED();
96 return SHELF_VISIBLE;
97 }
98
99 gfx::Rect WmShelfMus::GetUserWorkAreaBounds() const {
100 NOTIMPLEMENTED();
101 return gfx::Rect();
102 }
103
104 void WmShelfMus::UpdateIconPositionForWindow(WmWindow* window) {
105 NOTIMPLEMENTED();
106 }
107
108 gfx::Rect WmShelfMus::GetIdealBounds() {
109 NOTIMPLEMENTED();
110 return gfx::Rect();
111 }
112
113 gfx::Rect WmShelfMus::GetScreenBoundsOfItemIconForWindow(WmWindow* window) {
114 NOTIMPLEMENTED();
115 return gfx::Rect();
116 }
117
118 bool WmShelfMus::ProcessGestureEvent(const ui::GestureEvent& event) {
119 NOTIMPLEMENTED();
120 return false;
121 }
122
123 void WmShelfMus::AddObserver(WmShelfObserver* observer) {
124 observers_.AddObserver(observer);
125 }
126
127 void WmShelfMus::RemoveObserver(WmShelfObserver* observer) {
128 observers_.RemoveObserver(observer);
129 }
130
131 void WmShelfMus::SetKeyboardBoundsForTesting(const gfx::Rect& bounds) {
132 NOTIMPLEMENTED();
133 }
134
135 ShelfLockingManager* WmShelfMus::GetShelfLockingManagerForTesting() {
136 NOTIMPLEMENTED();
137 return nullptr;
138 }
139
140 ShelfView* WmShelfMus::GetShelfViewForTesting() {
141 NOTIMPLEMENTED();
142 return nullptr;
143 }
144
145 } // namespace mus 39 } // namespace mus
146 } // namespace ash 40 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698