| 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_window.h" | 10 #include "ash/common/wm_window.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 ShelfItemType GetShelfItemType(ShelfID id) { | 21 ShelfItemType GetShelfItemType(ShelfID id) { |
| 22 ShelfModel* model = Shell::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 : ShelfItemDelegate(AppLaunchId()), id_(id), window_(window) { |
| 32 DCHECK_NE(kInvalidShelfID, id_); | 32 DCHECK_NE(kInvalidShelfID, id_); |
| 33 DCHECK(window_); | 33 DCHECK(window_); |
| 34 } | 34 } |
| 35 | 35 |
| 36 ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {} | 36 ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {} |
| 37 | 37 |
| 38 void ShelfWindowWatcherItemDelegate::ItemSelected( | 38 void ShelfWindowWatcherItemDelegate::ItemSelected( |
| 39 std::unique_ptr<ui::Event> event, | 39 std::unique_ptr<ui::Event> event, |
| 40 int64_t display_id, | 40 int64_t display_id, |
| 41 ShelfLaunchSource source, | 41 ShelfLaunchSource source, |
| (...skipping 22 matching lines...) Expand all 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 |