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_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 new LauncherArcAppUpdater(this, profile_)); | 1588 new LauncherArcAppUpdater(this, profile_)); |
1589 app_updaters_.push_back(std::move(arc_app_updater)); | 1589 app_updaters_.push_back(std::move(arc_app_updater)); |
1590 } | 1590 } |
1591 | 1591 |
1592 app_list::AppListSyncableService* app_service = | 1592 app_list::AppListSyncableService* app_service = |
1593 app_list::AppListSyncableServiceFactory::GetForProfile(profile_); | 1593 app_list::AppListSyncableServiceFactory::GetForProfile(profile_); |
1594 if (app_service) | 1594 if (app_service) |
1595 app_service->AddObserverAndStart(this); | 1595 app_service->AddObserverAndStart(this); |
1596 } | 1596 } |
1597 | 1597 |
| 1598 void ChromeLauncherControllerImpl::SetProfileForTest(Profile* profile) { |
| 1599 profile_ = profile; |
| 1600 } |
| 1601 |
1598 void ChromeLauncherControllerImpl::ReleaseProfile() { | 1602 void ChromeLauncherControllerImpl::ReleaseProfile() { |
1599 if (app_sync_ui_state_) | 1603 if (app_sync_ui_state_) |
1600 app_sync_ui_state_->RemoveObserver(this); | 1604 app_sync_ui_state_->RemoveObserver(this); |
1601 | 1605 |
1602 app_updaters_.clear(); | 1606 app_updaters_.clear(); |
1603 | 1607 |
1604 prefs_observer_.reset(); | 1608 prefs_observer_.reset(); |
1605 | 1609 |
1606 pref_change_registrar_.RemoveAll(); | 1610 pref_change_registrar_.RemoveAll(); |
1607 | 1611 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 if (index == -1) | 1712 if (index == -1) |
1709 continue; | 1713 continue; |
1710 ash::ShelfItem item = model_->items()[index]; | 1714 ash::ShelfItem item = model_->items()[index]; |
1711 item.image = image; | 1715 item.image = image; |
1712 if (arc_deferred_launcher_) | 1716 if (arc_deferred_launcher_) |
1713 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1717 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
1714 model_->Set(index, item); | 1718 model_->Set(index, item); |
1715 // It's possible we're waiting on more than one item, so don't break. | 1719 // It's possible we're waiting on more than one item, so don't break. |
1716 } | 1720 } |
1717 } | 1721 } |
OLD | NEW |