summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/ungoogled-chromium/disable-signin.patch
blob: b2b6081335d08e405ab26d966b2903e16f3f11a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Disables browser sign-in

--- chrome/browser/ui/chrome_pages.cc.orig
+++ chrome/browser/ui/chrome_pages.cc
@@ -480,32 +480,6 @@ GURL GetOSSettingsUrl(const std::string&
 void ShowBrowserSignin(Browser* browser,
                        signin_metrics::AccessPoint access_point,
                        signin::ConsentLevel consent_level) {
-  Profile* original_profile = browser->profile()->GetOriginalProfile();
-  DCHECK(original_profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed));
-
-  // If the browser's profile is an incognito profile, make sure to use
-  // a browser window from the original profile. The user cannot sign in
-  // from an incognito window.
-  auto displayer =
-      std::make_unique<ScopedTabbedBrowserDisplayer>(original_profile);
-  browser = displayer->browser();
-
-  profiles::BubbleViewMode bubble_view_mode;
-  if (IdentityManagerFactory::GetForProfile(original_profile)
-          ->HasPrimaryAccount(signin::ConsentLevel::kSync)) {
-    bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH;
-  } else {
-    switch (consent_level) {
-      case signin::ConsentLevel::kSync:
-        bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN;
-        break;
-      case signin::ConsentLevel::kSignin:
-        bubble_view_mode = profiles::BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT;
-        break;
-    }
-  }
-
-  browser->signin_view_controller()->ShowSignin(bubble_view_mode, access_point);
 }
 
 void ShowBrowserSigninOrSettings(Browser* browser,