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

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

Issue 2230723003: mash: Show status area widget, attempt 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: placeholder widget 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
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.h ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shell_window_ids.h"
8 #include "ash/common/wm_root_window_controller.h"
7 #include "ash/mus/bridge/wm_window_mus.h" 9 #include "ash/mus/bridge/wm_window_mus.h"
8 #include "ash/mus/shelf_layout_manager.h"
9 #include "services/ui/public/cpp/window.h" 10 #include "services/ui/public/cpp/window.h"
11 #include "ui/views/widget/widget.h"
10 12
11 // TODO(sky): fully implement this http://crbug.com/612631 . 13 // TODO(sky): fully implement this http://crbug.com/612631 .
12 #undef NOTIMPLEMENTED 14 #undef NOTIMPLEMENTED
13 #define NOTIMPLEMENTED() DVLOG(1) << "notimplemented" 15 #define NOTIMPLEMENTED() DVLOG(1) << "notimplemented"
14 16
15 namespace ash { 17 namespace ash {
16 namespace mus { 18 namespace mus {
17 19
18 WmShelfMus::WmShelfMus(ShelfLayoutManager* shelf_layout_manager) 20 WmShelfMus::WmShelfMus(WmRootWindowController* root_window_controller) {
19 : shelf_layout_manager_(shelf_layout_manager) {} 21 DCHECK(root_window_controller);
22 // Create a placehold shelf widget, because the status area code assumes it
msw 2016/08/10 18:37:36 nit: placeholder
23 // can access one.
24 // TODO(jamescook): Create a real shelf widget. http://crbug.com/615155
25 shelf_widget_ = new views::Widget;
26 views::Widget::InitParams params(
27 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
28 root_window_controller->ConfigureWidgetInitParamsForContainer(
29 shelf_widget_, kShellWindowId_ShelfContainer, &params);
30 shelf_widget_->Init(params);
31 }
20 32
21 WmShelfMus::~WmShelfMus() {} 33 WmShelfMus::~WmShelfMus() {}
22 34
23 WmWindow* WmShelfMus::GetWindow() { 35 WmWindow* WmShelfMus::GetWindow() {
24 return WmWindowMus::Get(shelf_layout_manager_->GetShelfWindow()); 36 return WmWindowMus::Get(shelf_widget_);
25 } 37 }
26 38
27 ShelfAlignment WmShelfMus::GetAlignment() const { 39 ShelfAlignment WmShelfMus::GetAlignment() const {
28 switch (shelf_layout_manager_->alignment()) { 40 NOTIMPLEMENTED();
29 case mash::shelf::mojom::Alignment::BOTTOM:
30 return SHELF_ALIGNMENT_BOTTOM;
31 case mash::shelf::mojom::Alignment::LEFT:
32 return SHELF_ALIGNMENT_LEFT;
33 case mash::shelf::mojom::Alignment::RIGHT:
34 return SHELF_ALIGNMENT_RIGHT;
35 }
36 NOTREACHED();
37 return SHELF_ALIGNMENT_BOTTOM; 41 return SHELF_ALIGNMENT_BOTTOM;
38 } 42 }
39 43
40 void WmShelfMus::SetAlignment(ShelfAlignment alignment) { 44 void WmShelfMus::SetAlignment(ShelfAlignment alignment) {
41 NOTIMPLEMENTED(); 45 NOTIMPLEMENTED();
42 } 46 }
43 47
44 ShelfAutoHideBehavior WmShelfMus::GetAutoHideBehavior() const { 48 ShelfAutoHideBehavior WmShelfMus::GetAutoHideBehavior() const {
45 NOTIMPLEMENTED(); 49 NOTIMPLEMENTED();
46 return SHELF_AUTO_HIDE_BEHAVIOR_NEVER; 50 return SHELF_AUTO_HIDE_BEHAVIOR_NEVER;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 NOTIMPLEMENTED(); 91 NOTIMPLEMENTED();
88 return true; 92 return true;
89 } 93 }
90 94
91 void WmShelfMus::UpdateVisibilityState() { 95 void WmShelfMus::UpdateVisibilityState() {
92 NOTIMPLEMENTED(); 96 NOTIMPLEMENTED();
93 } 97 }
94 98
95 ShelfVisibilityState WmShelfMus::GetVisibilityState() const { 99 ShelfVisibilityState WmShelfMus::GetVisibilityState() const {
96 NOTIMPLEMENTED(); 100 NOTIMPLEMENTED();
97 return shelf_layout_manager_->GetShelfWindow() ? SHELF_VISIBLE : SHELF_HIDDEN; 101 return SHELF_VISIBLE;
98 } 102 }
99 103
100 gfx::Rect WmShelfMus::GetUserWorkAreaBounds() const { 104 gfx::Rect WmShelfMus::GetUserWorkAreaBounds() const {
101 NOTIMPLEMENTED(); 105 NOTIMPLEMENTED();
102 return gfx::Rect(); 106 return gfx::Rect();
103 } 107 }
104 108
105 void WmShelfMus::UpdateIconPositionForWindow(WmWindow* window) { 109 void WmShelfMus::UpdateIconPositionForWindow(WmWindow* window) {
106 NOTIMPLEMENTED(); 110 NOTIMPLEMENTED();
107 } 111 }
(...skipping 30 matching lines...) Expand all
138 return nullptr; 142 return nullptr;
139 } 143 }
140 144
141 ShelfView* WmShelfMus::GetShelfViewForTesting() { 145 ShelfView* WmShelfMus::GetShelfViewForTesting() {
142 NOTIMPLEMENTED(); 146 NOTIMPLEMENTED();
143 return nullptr; 147 return nullptr;
144 } 148 }
145 149
146 } // namespace mus 150 } // namespace mus
147 } // namespace ash 151 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.h ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698