OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/shelf/shelf_window_watcher_item_delegate.h" | 5 #include "ash/common/shelf/shelf_window_watcher_item_delegate.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_controller.h" | 7 #include "ash/common/shelf/shelf_controller.h" |
8 #include "ash/common/shelf/shelf_model.h" | 8 #include "ash/common/shelf/shelf_model.h" |
9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
10 #include "ash/common/wm_shell.h" | |
11 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
12 #include "ash/public/cpp/window_properties.h" | 11 #include "ash/public/cpp/window_properties.h" |
| 12 #include "ash/shell.h" |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/events/event_constants.h" | 15 #include "ui/events/event_constants.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 ShelfItemType GetShelfItemType(ShelfID id) { | 21 ShelfItemType GetShelfItemType(ShelfID id) { |
22 ShelfModel* model = WmShell::Get()->shelf_controller()->model(); | 22 ShelfModel* model = Shell::Get()->shelf_controller()->model(); |
23 ShelfItems::const_iterator item = model->ItemByID(id); | 23 ShelfItems::const_iterator item = model->ItemByID(id); |
24 return item == model->items().end() ? TYPE_UNDEFINED : item->type; | 24 return item == model->items().end() ? TYPE_UNDEFINED : item->type; |
25 } | 25 } |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id, | 29 ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id, |
30 WmWindow* window) | 30 WmWindow* window) |
31 : id_(id), window_(window) { | 31 : id_(id), window_(window) { |
32 DCHECK_NE(kInvalidShelfID, id_); | 32 DCHECK_NE(kInvalidShelfID, id_); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 void ShelfWindowWatcherItemDelegate::ExecuteCommand(uint32_t command_id, | 66 void ShelfWindowWatcherItemDelegate::ExecuteCommand(uint32_t command_id, |
67 int32_t event_flags) {} | 67 int32_t event_flags) {} |
68 | 68 |
69 void ShelfWindowWatcherItemDelegate::Close() { | 69 void ShelfWindowWatcherItemDelegate::Close() { |
70 window_->CloseWidget(); | 70 window_->CloseWidget(); |
71 } | 71 } |
72 | 72 |
73 } // namespace ash | 73 } // namespace ash |
OLD | NEW |