| Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| index ea4a4571ce9dce5f207459e7d9f3914768c6253c..a45f04f630567bcfdebc5728f0edd2b5ffb9ebb5 100644
|
| --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
|
| @@ -913,12 +913,14 @@ void ChromeLauncherControllerImpl::OnShelfVisibilityStateChanged(
|
|
|
| ash::ShelfID ChromeLauncherControllerImpl::GetShelfIDForAppID(
|
| const std::string& app_id) {
|
| + const std::string shelf_app_id =
|
| + ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id);
|
| for (IDToItemControllerMap::const_iterator i =
|
| id_to_item_controller_map_.begin();
|
| i != id_to_item_controller_map_.end(); ++i) {
|
| if (i->second->type() == LauncherItemController::TYPE_APP_PANEL)
|
| continue; // Don't include panels
|
| - if (i->second->app_id() == app_id)
|
| + if (i->second->app_id() == shelf_app_id)
|
| return i->first;
|
| }
|
| return 0;
|
| @@ -937,27 +939,33 @@ const std::string& ChromeLauncherControllerImpl::GetAppIDForShelfID(
|
| }
|
|
|
| void ChromeLauncherControllerImpl::PinAppWithID(const std::string& app_id) {
|
| - if (GetPinnableForAppID(app_id, profile_) ==
|
| + const std::string shelf_app_id =
|
| + ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id);
|
| + if (GetPinnableForAppID(shelf_app_id, profile_) ==
|
| AppListControllerDelegate::PIN_EDITABLE)
|
| - DoPinAppWithID(app_id);
|
| + DoPinAppWithID(shelf_app_id);
|
| else
|
| NOTREACHED();
|
| }
|
|
|
| bool ChromeLauncherControllerImpl::IsAppPinned(const std::string& app_id) {
|
| + const std::string shelf_app_id =
|
| + ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id);
|
| for (IDToItemControllerMap::const_iterator i =
|
| id_to_item_controller_map_.begin();
|
| i != id_to_item_controller_map_.end(); ++i) {
|
| - if (IsPinned(i->first) && i->second->app_id() == app_id)
|
| + if (IsPinned(i->first) && i->second->app_id() == shelf_app_id)
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| void ChromeLauncherControllerImpl::UnpinAppWithID(const std::string& app_id) {
|
| - if (GetPinnableForAppID(app_id, profile_) ==
|
| + const std::string shelf_app_id =
|
| + ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id);
|
| + if (GetPinnableForAppID(shelf_app_id, profile_) ==
|
| AppListControllerDelegate::PIN_EDITABLE)
|
| - DoUnpinAppWithID(app_id, true /* update_prefs */);
|
| + DoUnpinAppWithID(shelf_app_id, true /* update_prefs */);
|
| else
|
| NOTREACHED();
|
| }
|
|
|