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

Unified Diff: chrome/test/base/testing_profile_manager.h

Issue 7648037: [Mac] Flip the flag for multi-profiles to on by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Un-needed includes Created 9 years, 4 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/test/base/testing_profile_manager.h
diff --git a/chrome/test/base/testing_profile_manager.h b/chrome/test/base/testing_profile_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8505b9429911b2cf4c7443266895f88b3a150a6
--- /dev/null
+++ b/chrome/test/base/testing_profile_manager.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_
+#define CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_
+
+#include <map>
+
+#include "base/compiler_specific.h"
+#include "chrome/browser/profiles/fake_profile_info_interface.h"
+#include "chrome/browser/profiles/profile_manager.h"
+
+class ProfileInfoCache;
+class TestingProfile;
+
+// The TestingProfileManager is used whenever a ProfileManager is needed in a
+// test environment. It overrides only GetProfileInfo() and friends, but at
+// some point in the future it may make use of the TestingProfiles it holds.
+class TestingProfileManager : public ProfileManager {
+ public:
+ typedef std::map<TestingProfile*, AvatarMenuModel::Item*> TestingProfiles;
+
+ TestingProfileManager();
+ virtual ~TestingProfileManager();
+
+ // Creates an AvatarMenuModel::Item for use in AddTestingProfile(). Caller
+ // owns the result.
+ static AvatarMenuModel::Item* CreateFakeInfo(
+ std::string name) WARN_UNUSED_RESULT;
+
+ // Adds a TestingProfile with an AvatarMenuModel::Item. The |info| is used by
+ // the FakeProfileInfo, while the TestingProfile is merely a way to key this
+ // information in your test. The |profile| is unused otherwise.
+ void AddTestingProfile(TestingProfile* profile, AvatarMenuModel::Item* info);
+
+ // Removes a profile and the corresponding AvatarMenuModel::Item from the
+ // |fake_profile_info_|.
+ void RemoveTestingProfile(TestingProfile* profile);
+
+ const TestingProfiles& testing_profiles() {
+ return testing_profiles_;
+ }
+
+ FakeProfileInfo& fake_profile_info() {
+ return fake_profile_info_;
+ }
+
+ // ProfileManager:
+ virtual ProfileInfoInterface& GetProfileInfo();
+ virtual ProfileInfoCache& GetMutableProfileInfo();
+
+ private:
+ TestingProfiles testing_profiles_;
+
+ FakeProfileInfo fake_profile_info_;
+};
+
+#endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698