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

Unified Diff: chrome/browser/ui/app_list/app_list_service_impl.h

Issue 24707002: Add unit tests for AppListServiceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_service_impl.h
diff --git a/chrome/browser/ui/app_list/app_list_service_impl.h b/chrome/browser/ui/app_list/app_list_service_impl.h
index 878b5ea181323f457a5f239f136e2d145e61c790..566bc63e19ff836a4631f3d81c8c01c59f7b5bda 100644
--- a/chrome/browser/ui/app_list/app_list_service_impl.h
+++ b/chrome/browser/ui/app_list/app_list_service_impl.h
@@ -13,8 +13,11 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache_observer.h"
-#include "chrome/browser/profiles/profile_loader.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
+#include "chrome/browser/ui/app_list/keep_alive_service.h"
+#include "chrome/browser/ui/app_list/profile_loader.h"
+
+class ProfileStore;
namespace base {
class FilePath;
@@ -26,16 +29,19 @@ class AppListServiceImpl : public AppListService,
public:
static void RecordAppListLaunch();
static void RecordAppListAppLaunch();
+ virtual ~AppListServiceImpl();
- protected:
AppListServiceImpl();
- virtual ~AppListServiceImpl();
+ // Constructor used for testing.
+ AppListServiceImpl(PrefService* local_state,
+ scoped_ptr<ProfileStore> profile_store,
+ scoped_ptr<KeepAliveService> keep_alive_service);
Profile* profile() const { return profile_; }
void SetProfile(Profile* new_profile);
void InvalidatePendingProfileLoads();
- ProfileLoader& profile_loader() { return profile_loader_; }
- const ProfileLoader& profile_loader() const { return profile_loader_; }
+ ProfileLoader& profile_loader() { return *profile_loader_; }
+ const ProfileLoader& profile_loader() const { return *profile_loader_; }
// Process command line flags shared between desktop implementations of the
// app list. Currently this allows for enabling or disabling the app list.
@@ -76,16 +82,12 @@ class AppListServiceImpl : public AppListService,
// The profile the AppList is currently displaying.
Profile* profile_;
-
- // Incremented to indicate that pending profile loads are no longer valid.
- int profile_load_sequence_id_;
-
- // How many profile loads are pending.
- int pending_profile_loads_;
+ scoped_ptr<ProfileStore> profile_store_;
base::WeakPtrFactory<AppListServiceImpl> weak_factory_;
- ProfileLoader profile_loader_;
+ PrefService* local_state_;
+ scoped_ptr<ProfileLoader> profile_loader_;
DISALLOW_COPY_AND_ASSIGN(AppListServiceImpl);
};

Powered by Google App Engine
This is Rietveld 408576698