Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |