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

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

Issue 2354613002: [Sync] Fix namespaces for the browser_sync component. (Closed)
Patch Set: Address comments. Created 4 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1380
1381 // By this point, all in-progress downloads for the profile being deleted 1381 // By this point, all in-progress downloads for the profile being deleted
1382 // must have been canceled (crbug.com/336725). 1382 // must have been canceled (crbug.com/336725).
1383 DCHECK(DownloadServiceFactory::GetForBrowserContext(profile)-> 1383 DCHECK(DownloadServiceFactory::GetForBrowserContext(profile)->
1384 NonMaliciousDownloadCount() == 0); 1384 NonMaliciousDownloadCount() == 0);
1385 BrowserList::CloseAllBrowsersWithProfile(profile); 1385 BrowserList::CloseAllBrowsersWithProfile(profile);
1386 1386
1387 // Disable sync for doomed profile. 1387 // Disable sync for doomed profile.
1388 if (ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( 1388 if (ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(
1389 profile)) { 1389 profile)) {
1390 ProfileSyncService* sync_service = 1390 browser_sync::ProfileSyncService* sync_service =
1391 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); 1391 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
1392 if (sync_service->IsSyncRequested()) { 1392 if (sync_service->IsSyncRequested()) {
1393 // Record sync stopped by profile destruction if it was on before. 1393 // Record sync stopped by profile destruction if it was on before.
1394 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", 1394 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource",
1395 syncer::PROFILE_DESTRUCTION, 1395 syncer::PROFILE_DESTRUCTION,
1396 syncer::STOP_SOURCE_LIMIT); 1396 syncer::STOP_SOURCE_LIMIT);
1397 } 1397 }
1398 // Ensure data is cleared even if sync was already off. 1398 // Ensure data is cleared even if sync was already off.
1399 ProfileSyncServiceFactory::GetInstance()->GetForProfile( 1399 ProfileSyncServiceFactory::GetInstance()
1400 profile)->RequestStop(ProfileSyncService::CLEAR_DATA); 1400 ->GetForProfile(profile)
1401 ->RequestStop(browser_sync::ProfileSyncService::CLEAR_DATA);
1401 } 1402 }
1402 1403
1403 ProfileAttributesEntry* entry; 1404 ProfileAttributesEntry* entry;
1404 bool has_entry = storage.GetProfileAttributesWithPath(profile_dir, &entry); 1405 bool has_entry = storage.GetProfileAttributesWithPath(profile_dir, &entry);
1405 DCHECK(has_entry); 1406 DCHECK(has_entry);
1406 ProfileMetrics::LogProfileDelete(entry->IsAuthenticated()); 1407 ProfileMetrics::LogProfileDelete(entry->IsAuthenticated());
1407 // Some platforms store passwords in keychains. They should be removed. 1408 // Some platforms store passwords in keychains. They should be removed.
1408 scoped_refptr<password_manager::PasswordStore> password_store = 1409 scoped_refptr<password_manager::PasswordStore> password_store =
1409 PasswordStoreFactory::GetForProfile( 1410 PasswordStoreFactory::GetForProfile(
1410 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); 1411 profile, ServiceAccessType::EXPLICIT_ACCESS).get();
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 1650
1650 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); 1651 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path);
1651 if (!original_callback.is_null()) 1652 if (!original_callback.is_null())
1652 original_callback.Run(loaded_profile, status); 1653 original_callback.Run(loaded_profile, status);
1653 } 1654 }
1654 #endif // !defined(OS_ANDROID) 1655 #endif // !defined(OS_ANDROID)
1655 1656
1656 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1657 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1657 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1658 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1658 } 1659 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/search/suggestions/suggestions_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698