Chromium Code Reviews| OLD | NEW |
|---|---|
| 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, ¶ms); | |
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |