| 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 const ash::ShelfItem& item = model_->items()[target_index]; | 1200 const ash::ShelfItem& item = model_->items()[target_index]; |
| 1201 // We remember the moved item position if it is either pinnable or | 1201 // We remember the moved item position if it is either pinnable or |
| 1202 // it is the app list with the alternate shelf layout. | 1202 // it is the app list with the alternate shelf layout. |
| 1203 if ((HasShelfIDToAppIDMapping(item.id) && IsPinned(item.id)) || | 1203 if ((HasShelfIDToAppIDMapping(item.id) && IsPinned(item.id)) || |
| 1204 item.type == ash::TYPE_APP_LIST) | 1204 item.type == ash::TYPE_APP_LIST) |
| 1205 PersistPinnedState(); | 1205 PersistPinnedState(); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 void ChromeLauncherController::ShelfItemChanged( | 1208 void ChromeLauncherController::ShelfItemChanged( |
| 1209 int index, | 1209 int index, |
| 1210 const ash::ShelfItem& old_item) { | 1210 const ash::ShelfItem& old_item) {} |
| 1211 } | |
| 1212 | |
| 1213 void ChromeLauncherController::ShelfStatusChanged() { | |
| 1214 } | |
| 1215 | 1211 |
| 1216 void ChromeLauncherController::ActiveUserChanged( | 1212 void ChromeLauncherController::ActiveUserChanged( |
| 1217 const std::string& user_email) { | 1213 const std::string& user_email) { |
| 1218 // Store the order of running applications for the user which gets inactive. | 1214 // Store the order of running applications for the user which gets inactive. |
| 1219 RememberUnpinnedRunningApplicationOrder(); | 1215 RememberUnpinnedRunningApplicationOrder(); |
| 1220 // Coming here the default profile is already switched. All profile specific | 1216 // Coming here the default profile is already switched. All profile specific |
| 1221 // resources get released and the new profile gets attached instead. | 1217 // resources get released and the new profile gets attached instead. |
| 1222 ReleaseProfile(); | 1218 ReleaseProfile(); |
| 1223 // When coming here, the active user has already be changed so that we can | 1219 // When coming here, the active user has already be changed so that we can |
| 1224 // set it as active. | 1220 // set it as active. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 MaybePropagatePrefToLocal(prefs, | 1328 MaybePropagatePrefToLocal(prefs, |
| 1333 prefs::kShelfAlignmentLocal, | 1329 prefs::kShelfAlignmentLocal, |
| 1334 prefs::kShelfAlignment); | 1330 prefs::kShelfAlignment); |
| 1335 MaybePropagatePrefToLocal(prefs, | 1331 MaybePropagatePrefToLocal(prefs, |
| 1336 prefs::kShelfAutoHideBehaviorLocal, | 1332 prefs::kShelfAutoHideBehaviorLocal, |
| 1337 prefs::kShelfAutoHideBehavior); | 1333 prefs::kShelfAutoHideBehavior); |
| 1338 } | 1334 } |
| 1339 | 1335 |
| 1340 void ChromeLauncherController::OnAppSyncUIStatusChanged() { | 1336 void ChromeLauncherController::OnAppSyncUIStatusChanged() { |
| 1341 if (app_sync_ui_state_->status() == AppSyncUIState::STATUS_SYNCING) | 1337 if (app_sync_ui_state_->status() == AppSyncUIState::STATUS_SYNCING) |
| 1342 model_->SetStatus(ash::ShelfModel::STATUS_LOADING); | 1338 model_->set_status(ash::ShelfModel::STATUS_LOADING); |
| 1343 else | 1339 else |
| 1344 model_->SetStatus(ash::ShelfModel::STATUS_NORMAL); | 1340 model_->set_status(ash::ShelfModel::STATUS_NORMAL); |
| 1345 } | 1341 } |
| 1346 | 1342 |
| 1347 void ChromeLauncherController::ExtensionEnableFlowFinished() { | 1343 void ChromeLauncherController::ExtensionEnableFlowFinished() { |
| 1348 LaunchApp(extension_enable_flow_->extension_id(), | 1344 LaunchApp(extension_enable_flow_->extension_id(), |
| 1349 ash::LAUNCH_FROM_UNKNOWN, | 1345 ash::LAUNCH_FROM_UNKNOWN, |
| 1350 ui::EF_NONE); | 1346 ui::EF_NONE); |
| 1351 extension_enable_flow_.reset(); | 1347 extension_enable_flow_.reset(); |
| 1352 } | 1348 } |
| 1353 | 1349 |
| 1354 void ChromeLauncherController::ExtensionEnableFlowAborted(bool user_initiated) { | 1350 void ChromeLauncherController::ExtensionEnableFlowAborted(bool user_initiated) { |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 | 2245 |
| 2250 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( | 2246 AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( |
| 2251 const std::string& app_id) { | 2247 const std::string& app_id) { |
| 2252 for (const auto& app_icon_loader : app_icon_loaders_) { | 2248 for (const auto& app_icon_loader : app_icon_loaders_) { |
| 2253 if (app_icon_loader->CanLoadImageForApp(app_id)) | 2249 if (app_icon_loader->CanLoadImageForApp(app_id)) |
| 2254 return app_icon_loader.get(); | 2250 return app_icon_loader.get(); |
| 2255 } | 2251 } |
| 2256 | 2252 |
| 2257 return nullptr; | 2253 return nullptr; |
| 2258 } | 2254 } |
| OLD | NEW |