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

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

Issue 1279543002: Support needed to measure user and service traffic in Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewHistogram
Patch Set: Adding sclittle to OWNERs and little fix in ChromeNetworkDelegate test. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 callback.Run(profile, Profile::CREATE_STATUS_INITIALIZED); 452 callback.Run(profile, Profile::CREATE_STATUS_INITIALIZED);
453 } else { 453 } else {
454 // Profile is either already in the process of being created, or new. 454 // Profile is either already in the process of being created, or new.
455 // Add callback to the list. 455 // Add callback to the list.
456 info->callbacks.push_back(callback); 456 info->callbacks.push_back(callback);
457 } 457 }
458 } 458 }
459 } 459 }
460 460
461 bool ProfileManager::IsValidProfile(Profile* profile) { 461 bool ProfileManager::IsValidProfile(Profile* profile) {
462 ProfileManager* pm = g_browser_process->profile_manager();
Alexei Svitkine (slow) 2015/08/31 17:26:31 Nit: Just inline this into the if, if you're only
amohammadkhan 2015/09/01 04:52:48 Done.
463 if (!pm) // Is NULL when running unit tests.
464 return false;
462 for (ProfilesInfoMap::iterator iter = profiles_info_.begin(); 465 for (ProfilesInfoMap::iterator iter = profiles_info_.begin();
463 iter != profiles_info_.end(); ++iter) { 466 iter != profiles_info_.end(); ++iter) {
464 if (iter->second->created) { 467 if (iter->second->created) {
465 Profile* candidate = iter->second->profile.get(); 468 Profile* candidate = iter->second->profile.get();
466 if (candidate == profile || 469 if (candidate == profile ||
467 (candidate->HasOffTheRecordProfile() && 470 (candidate->HasOffTheRecordProfile() &&
468 candidate->GetOffTheRecordProfile() == profile)) { 471 candidate->GetOffTheRecordProfile() == profile)) {
469 return true; 472 return true;
470 } 473 }
471 } 474 }
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 } 1480 }
1478 1481
1479 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1482 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1480 if (!original_callback.is_null()) 1483 if (!original_callback.is_null())
1481 original_callback.Run(loaded_profile, status); 1484 original_callback.Run(loaded_profile, status);
1482 } 1485 }
1483 1486
1484 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1487 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1485 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1488 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1486 } 1489 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698