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/common/shelf/shelf_controller.h" | 5 #include "ash/common/shelf/shelf_controller.h" |
6 | 6 |
7 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 7 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 int64_t display_id) { | 105 int64_t display_id) { |
106 WmShelf* shelf = GetShelfForDisplay(display_id); | 106 WmShelf* shelf = GetShelfForDisplay(display_id); |
107 // TODO(jamescook): The initialization check should not be necessary, but | 107 // TODO(jamescook): The initialization check should not be necessary, but |
108 // otherwise this wrongly tries to set auto-hide state on a secondary display | 108 // otherwise this wrongly tries to set auto-hide state on a secondary display |
109 // during login before the ShelfView is created. | 109 // during login before the ShelfView is created. |
110 if (shelf && shelf->IsShelfInitialized()) | 110 if (shelf && shelf->IsShelfInitialized()) |
111 shelf->SetAutoHideBehavior(auto_hide); | 111 shelf->SetAutoHideBehavior(auto_hide); |
112 } | 112 } |
113 | 113 |
114 void ShelfController::PinItem( | 114 void ShelfController::PinItem( |
115 mojom::ShelfItemPtr item, | 115 const ShelfItem& item, |
116 mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { | 116 mojom::ShelfItemDelegateAssociatedPtrInfo delegate) { |
117 NOTIMPLEMENTED(); | 117 NOTIMPLEMENTED(); |
118 } | 118 } |
119 | 119 |
120 void ShelfController::UnpinItem(const std::string& app_id) { | 120 void ShelfController::UnpinItem(const std::string& app_id) { |
121 NOTIMPLEMENTED(); | 121 NOTIMPLEMENTED(); |
122 } | 122 } |
123 | 123 |
124 void ShelfController::SetItemImage(const std::string& app_id, | 124 void ShelfController::SetItemImage(const std::string& app_id, |
125 const SkBitmap& image) { | 125 const SkBitmap& image) { |
126 if (!app_id_to_shelf_id_.count(app_id)) | 126 if (!app_id_to_shelf_id_.count(app_id)) |
127 return; | 127 return; |
128 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; | 128 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; |
129 int index = model_.ItemIndexByID(shelf_id); | 129 int index = model_.ItemIndexByID(shelf_id); |
130 DCHECK_GE(index, 0); | 130 DCHECK_GE(index, 0); |
131 ShelfItem item = *model_.ItemByID(shelf_id); | 131 ShelfItem item = *model_.ItemByID(shelf_id); |
132 item.image = GetShelfIconFromBitmap(image); | 132 item.image = GetShelfIconFromBitmap(image); |
133 model_.Set(index, item); | 133 model_.Set(index, item); |
134 } | 134 } |
135 | 135 |
136 } // namespace ash | 136 } // namespace ash |
OLD | NEW |