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

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

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.cc
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8c7c3468105028fd1b54922a1074f565cfc36a34
--- /dev/null
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -0,0 +1,54 @@
+// 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.
+
+#include "chrome/test/base/testing_profile_manager.h"
+
+#include <algorithm>
+
+#include "base/utf_string_conversions.h"
+
+TestingProfileManager::TestingProfileManager() {
+}
+
+TestingProfileManager::~TestingProfileManager() {
+}
+
+// static
+AvatarMenuModel::Item* TestingProfileManager::CreateFakeInfo(std::string name) {
+ AvatarMenuModel::Item* item =
+ new AvatarMenuModel::Item(0, FakeProfileInfo::GetTestImage());
+ item->name = UTF8ToUTF16(name);
+ return item;
+}
+
+void TestingProfileManager::AddTestingProfile(TestingProfile* profile,
+ AvatarMenuModel::Item* info) {
+ testing_profiles_.insert(std::make_pair(profile, info));
+ fake_profile_info_.mock_profiles()->push_back(info);
+}
+
+void TestingProfileManager::RemoveTestingProfile(TestingProfile* profile) {
+ std::map<TestingProfile*, AvatarMenuModel::Item*>::iterator it(
+ testing_profiles_.find(profile));
+ DCHECK(it != testing_profiles_.end());
+
+ AvatarMenuModel::Item* info = it->second;
+ std::vector<AvatarMenuModel::Item*>* info_list =
+ fake_profile_info_.mock_profiles();
+ std::vector<AvatarMenuModel::Item*>::iterator info_it(
+ std::find(info_list->begin(), info_list->end(), info));
+ DCHECK(info_it != fake_profile_info_.mock_profiles()->end());
+
+ testing_profiles_.erase(it);
+ fake_profile_info_.mock_profiles()->erase(info_it);
+}
+
+ProfileInfoInterface& TestingProfileManager::GetProfileInfo() {
+ return fake_profile_info_;
+}
+
+ProfileInfoCache& TestingProfileManager::GetMutableProfileInfo() {
+ NOTIMPLEMENTED();
+ return ProfileManager::GetMutableProfileInfo();
+}

Powered by Google App Engine
This is Rietveld 408576698