disable-signin.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Disables browser sign-in
  2. --- a/chrome/browser/ui/chrome_pages.cc
  3. +++ b/chrome/browser/ui/chrome_pages.cc
  4. @@ -525,32 +525,6 @@ GURL GetOSSettingsUrl(const std::string&
  5. void ShowBrowserSignin(Browser* browser,
  6. signin_metrics::AccessPoint access_point,
  7. signin::ConsentLevel consent_level) {
  8. - Profile* original_profile = browser->profile()->GetOriginalProfile();
  9. - DCHECK(original_profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed));
  10. -
  11. - // If the browser's profile is an incognito profile, make sure to use
  12. - // a browser window from the original profile. The user cannot sign in
  13. - // from an incognito window.
  14. - auto displayer =
  15. - std::make_unique<ScopedTabbedBrowserDisplayer>(original_profile);
  16. - browser = displayer->browser();
  17. -
  18. - profiles::BubbleViewMode bubble_view_mode;
  19. - if (IdentityManagerFactory::GetForProfile(original_profile)
  20. - ->HasPrimaryAccount(signin::ConsentLevel::kSync)) {
  21. - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH;
  22. - } else {
  23. - switch (consent_level) {
  24. - case signin::ConsentLevel::kSync:
  25. - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN;
  26. - break;
  27. - case signin::ConsentLevel::kSignin:
  28. - bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT;
  29. - break;
  30. - }
  31. - }
  32. -
  33. - browser->signin_view_controller()->ShowSignin(bubble_view_mode, access_point);
  34. }
  35. void ShowBrowserSigninOrSettings(Browser* browser,