#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/app_list/profile_loader.h"
+class AppListViewDelegate;
class ProfileStore;
namespace base {
class FilePath;
}
+namespace test {
+class AppListServiceImplTestApi;
+}
+
// Parts of the AppListService implementation shared between platforms.
class AppListServiceImpl : public AppListService,
public ProfileInfoCacheObserver {
PrefService* local_state,
scoped_ptr<ProfileStore> profile_store);
+ // Lazily create the Chrome AppListViewDelegate and ensure it is set to the
+ // given |profile|.
+ AppListViewDelegate* GetViewDelegate(Profile* profile);
+
void RecordAppListLaunch();
static void RecordAppListAppLaunch();
virtual void AutoShowForProfile(Profile* requested_profile) OVERRIDE;
virtual void EnableAppList(Profile* initial_profile,
AppListEnableSource enable_source) OVERRIDE;
+ virtual void CreateShortcut() OVERRIDE;
protected:
AppListServiceImpl();
+ // Destroy the app list. Called when the profile that the app list is showing
+ // is being deleted.
+ virtual void DestroyAppList() = 0;
+
void InvalidatePendingProfileLoads();
ProfileLoader& profile_loader() { return *profile_loader_; }
const ProfileLoader& profile_loader() const { return *profile_loader_; }
// list, and records UMA stats delayed from a previous Chrome process.
void PerformStartupChecks(Profile* initial_profile);
- // Create a platform-specific shortcut for the app list.
- virtual void CreateShortcut();
-
private:
+ friend class test::AppListServiceImplTestApi;
static void SendAppListStats();
// Loads a profile asynchronously and calls OnProfileLoaded() when done.
const base::FilePath& profile_path) OVERRIDE;
scoped_ptr<ProfileStore> profile_store_;
- base::WeakPtrFactory<AppListServiceImpl> weak_factory_;
base::CommandLine command_line_;
PrefService* local_state_;
scoped_ptr<ProfileLoader> profile_loader_;
+ scoped_ptr<AppListViewDelegate> view_delegate_;
+
+ base::WeakPtrFactory<AppListServiceImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AppListServiceImpl);
};