Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: ash/mus/shelf_delegate_mus.cc

Issue 2290603002: Enhance chrome.app.window API for shelf integration with pinning support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LauncherItemController Unit Tests Fix after Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/mus/shelf_delegate_mus.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/shelf_delegate_mus.h" 5 #include "ash/mus/shelf_delegate_mus.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/common/shelf/shelf_item_delegate.h" 9 #include "ash/common/shelf/shelf_item_delegate.h"
10 #include "ash/common/shelf/shelf_menu_model.h" 10 #include "ash/common/shelf/shelf_menu_model.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void ShelfDelegateMus::OnShelfAutoHideStateChanged(WmShelf* shelf) {} 194 void ShelfDelegateMus::OnShelfAutoHideStateChanged(WmShelf* shelf) {}
195 195
196 void ShelfDelegateMus::OnShelfVisibilityStateChanged(WmShelf* shelf) {} 196 void ShelfDelegateMus::OnShelfVisibilityStateChanged(WmShelf* shelf) {}
197 197
198 ShelfID ShelfDelegateMus::GetShelfIDForAppID(const std::string& app_id) { 198 ShelfID ShelfDelegateMus::GetShelfIDForAppID(const std::string& app_id) {
199 if (app_id_to_shelf_id_.count(app_id)) 199 if (app_id_to_shelf_id_.count(app_id))
200 return app_id_to_shelf_id_[app_id]; 200 return app_id_to_shelf_id_[app_id];
201 return 0; 201 return 0;
202 } 202 }
203 203
204 ShelfID ShelfDelegateMus::GetShelfIDForAppIDAndLaunchID(
205 const std::string& app_id,
206 const std::string& launch_id) {
207 return ShelfDelegateMus::GetShelfIDForAppID(app_id);
208 }
209
204 bool ShelfDelegateMus::HasShelfIDToAppIDMapping(ShelfID id) const { 210 bool ShelfDelegateMus::HasShelfIDToAppIDMapping(ShelfID id) const {
205 return shelf_id_to_app_id_.count(id) != 0; 211 return shelf_id_to_app_id_.count(id) != 0;
206 } 212 }
207 213
208 const std::string& ShelfDelegateMus::GetAppIDForShelfID(ShelfID id) { 214 const std::string& ShelfDelegateMus::GetAppIDForShelfID(ShelfID id) {
209 if (shelf_id_to_app_id_.count(id)) 215 if (shelf_id_to_app_id_.count(id))
210 return shelf_id_to_app_id_[id]; 216 return shelf_id_to_app_id_[id];
211 return base::EmptyString(); 217 return base::EmptyString();
212 } 218 }
213 219
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 return; 315 return;
310 ShelfID shelf_id = app_id_to_shelf_id_[app_id]; 316 ShelfID shelf_id = app_id_to_shelf_id_[app_id];
311 int index = model_->ItemIndexByID(shelf_id); 317 int index = model_->ItemIndexByID(shelf_id);
312 DCHECK_GE(index, 0); 318 DCHECK_GE(index, 0);
313 ShelfItem item = *model_->ItemByID(shelf_id); 319 ShelfItem item = *model_->ItemByID(shelf_id);
314 item.image = GetShelfIconFromBitmap(image); 320 item.image = GetShelfIconFromBitmap(image);
315 model_->Set(index, item); 321 model_->Set(index, item);
316 } 322 }
317 323
318 } // namespace ash 324 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/shelf_delegate_mus.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698