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

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

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extract managed user specific stuff into another changelist. 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
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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 *error_message_id = 0; 397 *error_message_id = 0;
398 398
399 if (!web_contents) 399 if (!web_contents)
400 return false; 400 return false;
401 401
402 if (web_contents->GetBrowserContext()->IsOffTheRecord()) 402 if (web_contents->GetBrowserContext()->IsOffTheRecord())
403 return false; 403 return false;
404 404
405 Profile* profile = 405 Profile* profile =
406 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 406 Profile::FromBrowserContext(web_contents->GetBrowserContext());
407 if (!profile) 407 if (!profile || !profile->IsSigninAllowed())
408 return false; 408 return false;
409 409
410 if (can_offer_for == CAN_OFFER_FOR_INTERSTITAL_ONLY && 410 if (can_offer_for == CAN_OFFER_FOR_INTERSTITAL_ONLY &&
411 !profile->GetPrefs()->GetBoolean(prefs::kReverseAutologinEnabled)) 411 !profile->GetPrefs()->GetBoolean(prefs::kReverseAutologinEnabled))
412 return false; 412 return false;
413 413
414 if (!SigninManager::AreSigninCookiesAllowed(profile)) 414 if (!SigninManager::AreSigninCookiesAllowed(profile))
415 return false; 415 return false;
416 416
417 if (!email.empty()) { 417 if (!email.empty()) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 return DONT_OFFER; 506 return DONT_OFFER;
507 507
508 if (!SyncPromoUI::UseWebBasedSigninFlow()) 508 if (!SyncPromoUI::UseWebBasedSigninFlow())
509 return DONT_OFFER; 509 return DONT_OFFER;
510 510
511 // Check for incognito before other parts of the io_data, since those 511 // Check for incognito before other parts of the io_data, since those
512 // members may not be initalized. 512 // members may not be initalized.
513 if (io_data->is_incognito()) 513 if (io_data->is_incognito())
514 return DONT_OFFER; 514 return DONT_OFFER;
515 515
516 if (!SigninManager::IsSigninAllowedOnIOThread(io_data))
517 return DONT_OFFER;
518
516 if (!io_data->reverse_autologin_enabled()->GetValue()) 519 if (!io_data->reverse_autologin_enabled()->GetValue())
517 return DONT_OFFER; 520 return DONT_OFFER;
518 521
519 if (!io_data->google_services_username()->GetValue().empty()) 522 if (!io_data->google_services_username()->GetValue().empty())
520 return DONT_OFFER; 523 return DONT_OFFER;
521 524
522 if (!SigninManager::AreSigninCookiesAllowed(io_data->GetCookieSettings())) 525 if (!SigninManager::AreSigninCookiesAllowed(io_data->GetCookieSettings()))
523 return DONT_OFFER; 526 return DONT_OFFER;
524 527
525 // The checks below depend on chrome already knowing what account the user 528 // The checks below depend on chrome already knowing what account the user
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 break; 1006 break;
1004 } 1007 }
1005 } 1008 }
1006 1009
1007 RedirectToNTP(); 1010 RedirectToNTP();
1008 } 1011 }
1009 1012
1010 void OneClickSigninHelper::SigninSuccess() { 1013 void OneClickSigninHelper::SigninSuccess() {
1011 RedirectToNTP(); 1014 RedirectToNTP();
1012 } 1015 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698