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

Side by Side Diff: chrome/browser/profiles/profile_manager.h

Issue 8502031: Refactor ProfileManager::DoFinalInit(...) to allow for a more flexible ProfileManagerWithoutInit.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This class keeps track of the currently-active profiles in the runtime. 5 // This class keeps track of the currently-active profiles in the runtime.
6 6
7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 7 #ifndef CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 8 #define CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
9 #pragma once 9 #pragma once
10 10
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Register and add testing profile to the ProfileManager. Use ONLY in tests. 188 // Register and add testing profile to the ProfileManager. Use ONLY in tests.
189 // This allows the creation of Profiles outside of the standard creation path 189 // This allows the creation of Profiles outside of the standard creation path
190 // for testing. If |addToCache|, add to ProfileInfoCache as well. 190 // for testing. If |addToCache|, add to ProfileInfoCache as well.
191 void RegisterTestingProfile(Profile* profile, bool addToCache); 191 void RegisterTestingProfile(Profile* profile, bool addToCache);
192 192
193 const FilePath& user_data_dir() const { return user_data_dir_; } 193 const FilePath& user_data_dir() const { return user_data_dir_; }
194 194
195 protected: 195 protected:
196 // Does final initial actions. 196 // Does final initial actions.
197 virtual void DoFinalInit(Profile* profile, bool go_off_the_record); 197 virtual void DoFinalInit(Profile* profile, bool go_off_the_record);
198 virtual void DoFinalServicesInit(Profile* profile, bool go_off_the_record);
199 virtual void DoFinalInitLogging(Profile* profile);
198 200
199 // Creates a new profile. Virtual so that unittests can return TestingProfile. 201 // Creates a new profile. Virtual so that unittests can return TestingProfile.
200 virtual Profile* CreateProfile(const FilePath& path); 202 virtual Profile* CreateProfile(const FilePath& path);
201 203
202 private: 204 private:
203 friend class TestingProfileManager; 205 friend class TestingProfileManager;
204 FRIEND_TEST(ProfileManagerBrowserTest, DeleteAllProfiles); 206 FRIEND_TEST(ProfileManagerBrowserTest, DeleteAllProfiles);
205 207
206 // This struct contains information about profiles which are being loaded or 208 // This struct contains information about profiles which are being loaded or
207 // were loaded. 209 // were loaded.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 DISALLOW_COPY_AND_ASSIGN(ProfileManager); 280 DISALLOW_COPY_AND_ASSIGN(ProfileManager);
279 }; 281 };
280 282
281 // Same as the ProfileManager, but doesn't initialize some services of the 283 // Same as the ProfileManager, but doesn't initialize some services of the
282 // profile. This one is useful in unittests. 284 // profile. This one is useful in unittests.
283 class ProfileManagerWithoutInit : public ProfileManager { 285 class ProfileManagerWithoutInit : public ProfileManager {
284 public: 286 public:
285 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir); 287 explicit ProfileManagerWithoutInit(const FilePath& user_data_dir);
286 288
287 protected: 289 protected:
288 virtual void DoFinalInit(Profile*, bool) {} 290 virtual void DoFinalServicesInit(Profile*, bool) {}
Robert Sesek 2011/11/09 19:07:46 OVERRIDE on both of these
291 virtual void DoFinalInitLogging(Profile*) {}
Robert Sesek 2011/11/09 19:07:46 I'd standardize the naming here. Either DoFinalIni
289 }; 292 };
290 293
291 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_ 294 #endif // CHROME_BROWSER_PROFILES_PROFILE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | chrome/browser/profiles/profile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698