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 "mash/wm/bridge/wm_shelf_mus.h" | 5 #include "ash/mus/bridge/wm_shelf_mus.h" |
6 | 6 |
| 7 #include "ash/mus/bridge/wm_window_mus.h" |
| 8 #include "ash/mus/shelf_layout_manager.h" |
7 #include "components/mus/public/cpp/window.h" | 9 #include "components/mus/public/cpp/window.h" |
8 #include "mash/wm/bridge/wm_window_mus.h" | |
9 #include "mash/wm/shelf_layout_manager.h" | |
10 | 10 |
11 // TODO(sky): fully implement this http://crbug.com/612631 . | 11 // TODO(sky): fully implement this http://crbug.com/612631 . |
12 #undef NOTIMPLEMENTED | 12 #undef NOTIMPLEMENTED |
13 #define NOTIMPLEMENTED() DVLOG(1) << "notimplemented" | 13 #define NOTIMPLEMENTED() DVLOG(1) << "notimplemented" |
14 | 14 |
15 namespace mash { | 15 namespace ash { |
16 namespace wm { | 16 namespace mus { |
17 | 17 |
18 WmShelfMus::WmShelfMus(ShelfLayoutManager* shelf_layout_manager) | 18 WmShelfMus::WmShelfMus(ShelfLayoutManager* shelf_layout_manager) |
19 : shelf_layout_manager_(shelf_layout_manager) {} | 19 : shelf_layout_manager_(shelf_layout_manager) {} |
20 | 20 |
21 WmShelfMus::~WmShelfMus() {} | 21 WmShelfMus::~WmShelfMus() {} |
22 | 22 |
23 ash::wm::WmWindow* WmShelfMus::GetWindow() { | 23 wm::WmWindow* WmShelfMus::GetWindow() { |
24 return WmWindowMus::Get(shelf_layout_manager_->GetShelfWindow()); | 24 return WmWindowMus::Get(shelf_layout_manager_->GetShelfWindow()); |
25 } | 25 } |
26 | 26 |
27 ash::wm::ShelfAlignment WmShelfMus::GetAlignment() const { | 27 wm::ShelfAlignment WmShelfMus::GetAlignment() const { |
28 switch (shelf_layout_manager_->alignment()) { | 28 switch (shelf_layout_manager_->alignment()) { |
29 case shelf::mojom::Alignment::BOTTOM: | 29 case mash::shelf::mojom::Alignment::BOTTOM: |
30 return ash::wm::SHELF_ALIGNMENT_BOTTOM; | 30 return wm::SHELF_ALIGNMENT_BOTTOM; |
31 case shelf::mojom::Alignment::LEFT: | 31 case mash::shelf::mojom::Alignment::LEFT: |
32 return ash::wm::SHELF_ALIGNMENT_LEFT; | 32 return wm::SHELF_ALIGNMENT_LEFT; |
33 case shelf::mojom::Alignment::RIGHT: | 33 case mash::shelf::mojom::Alignment::RIGHT: |
34 return ash::wm::SHELF_ALIGNMENT_RIGHT; | 34 return wm::SHELF_ALIGNMENT_RIGHT; |
35 } | 35 } |
36 NOTREACHED(); | 36 NOTREACHED(); |
37 return ash::wm::SHELF_ALIGNMENT_BOTTOM; | 37 return wm::SHELF_ALIGNMENT_BOTTOM; |
38 } | 38 } |
39 | 39 |
40 ash::wm::ShelfBackgroundType WmShelfMus::GetBackgroundType() const { | 40 wm::ShelfBackgroundType WmShelfMus::GetBackgroundType() const { |
41 NOTIMPLEMENTED(); | 41 NOTIMPLEMENTED(); |
42 return ash::wm::SHELF_BACKGROUND_DEFAULT; | 42 return wm::SHELF_BACKGROUND_DEFAULT; |
43 } | 43 } |
44 | 44 |
45 void WmShelfMus::UpdateVisibilityState() { | 45 void WmShelfMus::UpdateVisibilityState() { |
46 NOTIMPLEMENTED(); | 46 NOTIMPLEMENTED(); |
47 } | 47 } |
48 | 48 |
49 ash::ShelfVisibilityState WmShelfMus::GetVisibilityState() const { | 49 ShelfVisibilityState WmShelfMus::GetVisibilityState() const { |
50 NOTIMPLEMENTED(); | 50 NOTIMPLEMENTED(); |
51 return shelf_layout_manager_->GetShelfWindow() ? ash::SHELF_VISIBLE | 51 return shelf_layout_manager_->GetShelfWindow() ? SHELF_VISIBLE : SHELF_HIDDEN; |
52 : ash::SHELF_HIDDEN; | |
53 } | 52 } |
54 | 53 |
55 void WmShelfMus::UpdateIconPositionForWindow(ash::wm::WmWindow* window) { | 54 void WmShelfMus::UpdateIconPositionForWindow(wm::WmWindow* window) { |
56 NOTIMPLEMENTED(); | 55 NOTIMPLEMENTED(); |
57 } | 56 } |
58 | 57 |
59 gfx::Rect WmShelfMus::GetScreenBoundsOfItemIconForWindow( | 58 gfx::Rect WmShelfMus::GetScreenBoundsOfItemIconForWindow(wm::WmWindow* window) { |
60 ash::wm::WmWindow* window) { | |
61 NOTIMPLEMENTED(); | 59 NOTIMPLEMENTED(); |
62 return gfx::Rect(); | 60 return gfx::Rect(); |
63 } | 61 } |
64 | 62 |
65 void WmShelfMus::AddObserver(ash::wm::WmShelfObserver* observer) { | 63 void WmShelfMus::AddObserver(wm::WmShelfObserver* observer) { |
66 observers_.AddObserver(observer); | 64 observers_.AddObserver(observer); |
67 } | 65 } |
68 | 66 |
69 void WmShelfMus::RemoveObserver(ash::wm::WmShelfObserver* observer) { | 67 void WmShelfMus::RemoveObserver(wm::WmShelfObserver* observer) { |
70 observers_.RemoveObserver(observer); | 68 observers_.RemoveObserver(observer); |
71 } | 69 } |
72 | 70 |
73 } // namespace wm | 71 } // namespace mus |
74 } // namespace mash | 72 } // namespace ash |
OLD | NEW |