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

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

Issue 809313009: Make the SigninErrorController a PKS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyrighted: 2015 Created 5 years, 11 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/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 19 matching lines...) Expand all
30 #include "chrome/browser/history/history_service.h" 30 #include "chrome/browser/history/history_service.h"
31 #include "chrome/browser/history/history_service_factory.h" 31 #include "chrome/browser/history/history_service_factory.h"
32 #include "chrome/browser/password_manager/chrome_password_manager_client.h" 32 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
33 #include "chrome/browser/profiles/profile.h" 33 #include "chrome/browser/profiles/profile.h"
34 #include "chrome/browser/profiles/profile_info_cache.h" 34 #include "chrome/browser/profiles/profile_info_cache.h"
35 #include "chrome/browser/profiles/profile_io_data.h" 35 #include "chrome/browser/profiles/profile_io_data.h"
36 #include "chrome/browser/profiles/profile_manager.h" 36 #include "chrome/browser/profiles/profile_manager.h"
37 #include "chrome/browser/search/search.h" 37 #include "chrome/browser/search/search.h"
38 #include "chrome/browser/signin/chrome_signin_client.h" 38 #include "chrome/browser/signin/chrome_signin_client.h"
39 #include "chrome/browser/signin/chrome_signin_client_factory.h" 39 #include "chrome/browser/signin/chrome_signin_client_factory.h"
40 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 40 #include "chrome/browser/signin/signin_error_controller_factory.h"
41 #include "chrome/browser/signin/signin_manager_factory.h" 41 #include "chrome/browser/signin/signin_manager_factory.h"
42 #include "chrome/browser/signin/signin_names_io_thread.h" 42 #include "chrome/browser/signin/signin_names_io_thread.h"
43 #include "chrome/browser/sync/profile_sync_service.h" 43 #include "chrome/browser/sync/profile_sync_service.h"
44 #include "chrome/browser/sync/profile_sync_service_factory.h" 44 #include "chrome/browser/sync/profile_sync_service_factory.h"
45 #include "chrome/browser/tab_contents/tab_util.h" 45 #include "chrome/browser/tab_contents/tab_util.h"
46 #include "chrome/browser/ui/browser_finder.h" 46 #include "chrome/browser/ui/browser_finder.h"
47 #include "chrome/browser/ui/browser_list.h" 47 #include "chrome/browser/ui/browser_list.h"
48 #include "chrome/browser/ui/browser_tabstrip.h" 48 #include "chrome/browser/ui/browser_tabstrip.h"
49 #include "chrome/browser/ui/browser_window.h" 49 #include "chrome/browser/ui/browser_window.h"
50 #include "chrome/browser/ui/chrome_pages.h" 50 #include "chrome/browser/ui/chrome_pages.h"
51 #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h" 51 #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h"
52 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" 52 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
53 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" 53 #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
54 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" 54 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
55 #include "chrome/browser/ui/tabs/tab_strip_model.h" 55 #include "chrome/browser/ui/tabs/tab_strip_model.h"
56 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 56 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
57 #include "chrome/common/chrome_version_info.h" 57 #include "chrome/common/chrome_version_info.h"
58 #include "chrome/common/net/url_util.h" 58 #include "chrome/common/net/url_util.h"
59 #include "chrome/common/pref_names.h" 59 #include "chrome/common/pref_names.h"
60 #include "chrome/common/url_constants.h" 60 #include "chrome/common/url_constants.h"
61 #include "chrome/grit/chromium_strings.h" 61 #include "chrome/grit/chromium_strings.h"
62 #include "chrome/grit/generated_resources.h" 62 #include "chrome/grit/generated_resources.h"
63 #include "components/autofill/core/common/password_form.h" 63 #include "components/autofill/core/common/password_form.h"
64 #include "components/google/core/browser/google_util.h" 64 #include "components/google/core/browser/google_util.h"
65 #include "components/password_manager/core/browser/password_manager.h" 65 #include "components/password_manager/core/browser/password_manager.h"
66 #include "components/signin/core/browser/profile_oauth2_token_service.h"
67 #include "components/signin/core/browser/signin_client.h" 66 #include "components/signin/core/browser/signin_client.h"
68 #include "components/signin/core/browser/signin_error_controller.h" 67 #include "components/signin/core/browser/signin_error_controller.h"
69 #include "components/signin/core/browser/signin_manager.h" 68 #include "components/signin/core/browser/signin_manager.h"
70 #include "components/signin/core/browser/signin_manager_cookie_helper.h" 69 #include "components/signin/core/browser/signin_manager_cookie_helper.h"
71 #include "components/signin/core/browser/signin_metrics.h" 70 #include "components/signin/core/browser/signin_metrics.h"
72 #include "components/signin/core/common/profile_management_switches.h" 71 #include "components/signin/core/common/profile_management_switches.h"
73 #include "components/sync_driver/sync_prefs.h" 72 #include "components/sync_driver/sync_prefs.h"
74 #include "content/public/browser/browser_thread.h" 73 #include "content/public/browser/browser_thread.h"
75 #include "content/public/browser/navigation_entry.h" 74 #include "content/public/browser/navigation_entry.h"
76 #include "content/public/browser/page_navigator.h" 75 #include "content/public/browser/page_navigator.h"
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 1425
1427 // - If sign in was initiated from the NTP or the hotdog menu, sync with 1426 // - If sign in was initiated from the NTP or the hotdog menu, sync with
1428 // default settings. 1427 // default settings.
1429 // - If sign in was initiated from the settings page for first time sync 1428 // - If sign in was initiated from the settings page for first time sync
1430 // set up, show the advanced sync settings dialog. 1429 // set up, show the advanced sync settings dialog.
1431 // - If sign in was initiated from the settings page due to a re-auth when 1430 // - If sign in was initiated from the settings page due to a re-auth when
1432 // sync was already setup, simply navigate back to the settings page. 1431 // sync was already setup, simply navigate back to the settings page.
1433 ProfileSyncService* sync_service = 1432 ProfileSyncService* sync_service =
1434 ProfileSyncServiceFactory::GetForProfile(profile); 1433 ProfileSyncServiceFactory::GetForProfile(profile);
1435 SigninErrorController* error_controller = 1434 SigninErrorController* error_controller =
1436 ProfileOAuth2TokenServiceFactory::GetForProfile(profile)-> 1435 SigninErrorControllerFactory::GetForProfile(profile);
1437 signin_error_controller();
1438 1436
1439 OneClickSigninSyncStarter::StartSyncMode start_mode = 1437 OneClickSigninSyncStarter::StartSyncMode start_mode =
1440 source_ == signin_metrics::SOURCE_SETTINGS ? 1438 source_ == signin_metrics::SOURCE_SETTINGS ?
1441 (error_controller->HasError() && 1439 (error_controller->HasError() &&
1442 sync_service && sync_service->HasSyncSetupCompleted()) ? 1440 sync_service && sync_service->HasSyncSetupCompleted()) ?
1443 OneClickSigninSyncStarter::SHOW_SETTINGS_WITHOUT_CONFIGURE : 1441 OneClickSigninSyncStarter::SHOW_SETTINGS_WITHOUT_CONFIGURE :
1444 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST : 1442 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST :
1445 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS; 1443 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS;
1446 1444
1447 if (!HandleCrossAccountError(profile, session_index_, email_, password_, 1445 if (!HandleCrossAccountError(profile, session_index_, email_, password_,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 // If the web contents is showing a blank page and not about to be closed, 1501 // If the web contents is showing a blank page and not about to be closed,
1504 // redirect to the NTP or apps page. 1502 // redirect to the NTP or apps page.
1505 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && 1503 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) &&
1506 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { 1504 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) {
1507 RedirectToNtpOrAppsPage( 1505 RedirectToNtpOrAppsPage(
1508 web_contents(), 1506 web_contents(),
1509 signin::GetSourceForPromoURL(original_continue_url_)); 1507 signin::GetSourceForPromoURL(original_continue_url_));
1510 } 1508 }
1511 } 1509 }
1512 } 1510 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698