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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 12313012: Adding a histrogram to track account missmatch for signin reauth. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/sync/signin_histogram.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/sync/one_click_signin_helper.h" 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 25 matching lines...) Expand all
36 #include "chrome/browser/sync/profile_sync_service.h" 36 #include "chrome/browser/sync/profile_sync_service.h"
37 #include "chrome/browser/sync/profile_sync_service_factory.h" 37 #include "chrome/browser/sync/profile_sync_service_factory.h"
38 #include "chrome/browser/sync/sync_prefs.h" 38 #include "chrome/browser/sync/sync_prefs.h"
39 #include "chrome/browser/tab_contents/tab_util.h" 39 #include "chrome/browser/tab_contents/tab_util.h"
40 #include "chrome/browser/ui/browser_finder.h" 40 #include "chrome/browser/ui/browser_finder.h"
41 #include "chrome/browser/ui/browser_window.h" 41 #include "chrome/browser/ui/browser_window.h"
42 #include "chrome/browser/ui/chrome_pages.h" 42 #include "chrome/browser/ui/chrome_pages.h"
43 #include "chrome/browser/ui/sync/one_click_signin_histogram.h" 43 #include "chrome/browser/ui/sync/one_click_signin_histogram.h"
44 #include "chrome/browser/ui/sync/one_click_signin_infobar_delegate.h" 44 #include "chrome/browser/ui/sync/one_click_signin_infobar_delegate.h"
45 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" 45 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
46 #include "chrome/browser/ui/sync/signin_histogram.h"
46 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" 47 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
47 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" 48 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
48 #include "chrome/common/chrome_notification_types.h" 49 #include "chrome/common/chrome_notification_types.h"
49 #include "chrome/common/chrome_switches.h" 50 #include "chrome/common/chrome_switches.h"
50 #include "chrome/common/chrome_version_info.h" 51 #include "chrome/common/chrome_version_info.h"
51 #include "chrome/common/net/url_util.h" 52 #include "chrome/common/net/url_util.h"
52 #include "chrome/common/one_click_signin_messages.h" 53 #include "chrome/common/one_click_signin_messages.h"
53 #include "chrome/common/pref_names.h" 54 #include "chrome/common/pref_names.h"
54 #include "chrome/common/url_constants.h" 55 #include "chrome/common/url_constants.h"
55 #include "content/public/browser/browser_thread.h" 56 #include "content/public/browser/browser_thread.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 if (error_message) { 562 if (error_message) {
562 error_message->assign( 563 error_message->assign(
563 l10n_util::GetStringFUTF8(IDS_SYNC_WRONG_EMAIL, 564 l10n_util::GetStringFUTF8(IDS_SYNC_WRONG_EMAIL,
564 UTF8ToUTF16(current_email))); 565 UTF8ToUTF16(current_email)));
565 } 566 }
566 return false; 567 return false;
567 } 568 }
568 569
569 // Make sure this username is not prohibited by policy. 570 // Make sure this username is not prohibited by policy.
570 if (!manager->IsAllowedUsername(email)) { 571 if (!manager->IsAllowedUsername(email)) {
572 UMA_HISTOGRAM_ENUMERATION("Signin.Reauth",
573 signin::HISTOGRAM_ACCOUNT_MISSMATCH,
574 signin::HISTOGRAM_MAX);
jwd 2013/02/20 22:41:27 Oh wow, this is totally wrong!
571 if (error_message) { 575 if (error_message) {
572 error_message->assign( 576 error_message->assign(
573 l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED)); 577 l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED));
574 } 578 }
575 return false; 579 return false;
576 } 580 }
577 581
578 // If some profile, not just the current one, is already connected to this 582 // If some profile, not just the current one, is already connected to this
579 // account, don't show the infobar. 583 // account, don't show the infobar.
580 if (g_browser_process && !same_email) { 584 if (g_browser_process && !same_email) {
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 break; 1171 break;
1168 } 1172 }
1169 } 1173 }
1170 1174
1171 RedirectToNTP(); 1175 RedirectToNTP();
1172 } 1176 }
1173 1177
1174 void OneClickSigninHelper::SigninSuccess() { 1178 void OneClickSigninHelper::SigninSuccess() {
1175 RedirectToNTP(); 1179 RedirectToNTP();
1176 } 1180 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/sync/signin_histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698