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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 338993007: Track when and how a profile is signed out via UMA. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove tracking android in separate UMA bucket Created 6 years, 6 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 | Annotate | Revision Log
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/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "chrome/common/chrome_version_info.h" 62 #include "chrome/common/chrome_version_info.h"
63 #include "chrome/common/pref_names.h" 63 #include "chrome/common/pref_names.h"
64 #include "chrome/common/url_constants.h" 64 #include "chrome/common/url_constants.h"
65 #include "components/gcm_driver/gcm_driver.h" 65 #include "components/gcm_driver/gcm_driver.h"
66 #include "components/invalidation/invalidation_service.h" 66 #include "components/invalidation/invalidation_service.h"
67 #include "components/invalidation/profile_invalidation_provider.h" 67 #include "components/invalidation/profile_invalidation_provider.h"
68 #include "components/pref_registry/pref_registry_syncable.h" 68 #include "components/pref_registry/pref_registry_syncable.h"
69 #include "components/signin/core/browser/about_signin_internals.h" 69 #include "components/signin/core/browser/about_signin_internals.h"
70 #include "components/signin/core/browser/profile_oauth2_token_service.h" 70 #include "components/signin/core/browser/profile_oauth2_token_service.h"
71 #include "components/signin/core/browser/signin_manager.h" 71 #include "components/signin/core/browser/signin_manager.h"
72 #include "components/signin/core/browser/signin_metrics.h"
72 #include "components/sync_driver/change_processor.h" 73 #include "components/sync_driver/change_processor.h"
73 #include "components/sync_driver/data_type_controller.h" 74 #include "components/sync_driver/data_type_controller.h"
74 #include "components/sync_driver/pref_names.h" 75 #include "components/sync_driver/pref_names.h"
75 #include "components/sync_driver/system_encryptor.h" 76 #include "components/sync_driver/system_encryptor.h"
76 #include "components/sync_driver/user_selectable_sync_type.h" 77 #include "components/sync_driver/user_selectable_sync_type.h"
77 #include "content/public/browser/notification_details.h" 78 #include "content/public/browser/notification_details.h"
78 #include "content/public/browser/notification_service.h" 79 #include "content/public/browser/notification_service.h"
79 #include "content/public/browser/notification_source.h" 80 #include "content/public/browser/notification_source.h"
80 #include "grit/generated_resources.h" 81 #include "grit/generated_resources.h"
81 #include "net/cookies/cookie_monster.h" 82 #include "net/cookies/cookie_monster.h"
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 ERROR_REASON_ACTIONABLE_ERROR); 1426 ERROR_REASON_ACTIONABLE_ERROR);
1426 break; 1427 break;
1427 case syncer::DISABLE_SYNC_AND_ROLLBACK: 1428 case syncer::DISABLE_SYNC_AND_ROLLBACK:
1428 backup_rollback_controller_.OnRollbackReceived(); 1429 backup_rollback_controller_.OnRollbackReceived();
1429 // Fall through to shutdown backend and sign user out. 1430 // Fall through to shutdown backend and sign user out.
1430 case syncer::DISABLE_SYNC_ON_CLIENT: 1431 case syncer::DISABLE_SYNC_ON_CLIENT:
1431 StopSyncingPermanently(); 1432 StopSyncingPermanently();
1432 #if !defined(OS_CHROMEOS) 1433 #if !defined(OS_CHROMEOS)
1433 // On desktop Chrome, sign out the user after a dashboard clear. 1434 // On desktop Chrome, sign out the user after a dashboard clear.
1434 // Skip sign out on ChromeOS/Android. 1435 // Skip sign out on ChromeOS/Android.
1435 if (!startup_controller_.auto_start_enabled()) 1436 if (!startup_controller_.auto_start_enabled()) {
1437 signin_metrics::LogSignout(signin_metrics::SERVER_FORCED_DISABLE);
1436 SigninManagerFactory::GetForProfile(profile_)->SignOut(); 1438 SigninManagerFactory::GetForProfile(profile_)->SignOut();
1439 }
1437 #endif 1440 #endif
1438 break; 1441 break;
1439 case syncer::ROLLBACK_DONE: 1442 case syncer::ROLLBACK_DONE:
1440 backup_rollback_controller_.OnRollbackDone(); 1443 backup_rollback_controller_.OnRollbackDone();
1441 break; 1444 break;
1442 case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT: 1445 case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT:
1443 // Sync disabled by domain admin. we should stop syncing until next 1446 // Sync disabled by domain admin. we should stop syncing until next
1444 // restart. 1447 // restart.
1445 sync_disabled_by_admin_ = true; 1448 sync_disabled_by_admin_ = true;
1446 ShutdownImpl(browser_sync::SyncBackendHost::DISABLE_AND_CLAIM_THREAD); 1449 ShutdownImpl(browser_sync::SyncBackendHost::DISABLE_AND_CLAIM_THREAD);
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 if (first_sync_time.is_null()) 2555 if (first_sync_time.is_null())
2553 return; 2556 return;
2554 2557
2555 clear_browsing_data_.Run(profile_, first_sync_time, base::Time::Now()); 2558 clear_browsing_data_.Run(profile_, first_sync_time, base::Time::Now());
2556 } 2559 }
2557 2560
2558 void ProfileSyncService::SetClearingBrowseringDataForTesting( 2561 void ProfileSyncService::SetClearingBrowseringDataForTesting(
2559 base::Callback<void(Profile*, base::Time, base::Time)> c) { 2562 base::Callback<void(Profile*, base::Time, base::Time)> c) {
2560 clear_browsing_data_ = c; 2563 clear_browsing_data_ = c;
2561 } 2564 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698