remove_usage_of_incognito_apis_in_the_spellchecker.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Samuel Attard <[email protected]>
  3. Date: Wed, 23 Oct 2019 11:43:58 -0700
  4. Subject: remove usage of incognito APIs in the spellchecker
  5. chrome::GetBrowserContextRedirectedInIncognito is not available in
  6. Electron nor do we want it to be. We could potentially upstream a
  7. change to move more of //chrome spellchecker logic into //components so
  8. that we can further separate our dependency from //chrome.
  9. diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc
  10. index 30a7e6a641e7b17a47fb5c66fb44d3d5899b9e78..85764a533585df0abe398758e4fd510c711de375 100644
  11. --- a/chrome/browser/profiles/profile_keyed_service_factory.cc
  12. +++ b/chrome/browser/profiles/profile_keyed_service_factory.cc
  13. @@ -22,6 +22,9 @@ ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() = default;
  14. content::BrowserContext* ProfileKeyedServiceFactory::GetBrowserContextToUse(
  15. content::BrowserContext* context) const {
  16. + return context;
  17. +#if 0
  18. Profile* profile = Profile::FromBrowserContext(context);
  19. return profile_selections_.ApplyProfileSelection(profile);
  20. +#endif
  21. }
  22. diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/profiles/profile_selections.cc
  23. index 25b15408665dc95702e7f1382fb8e7c0bb493599..bc0bad82ebcdceadc505e912ff27202b452fefab 100644
  24. --- a/chrome/browser/profiles/profile_selections.cc
  25. +++ b/chrome/browser/profiles/profile_selections.cc
  26. @@ -132,6 +132,7 @@ ProfileSelection ProfileSelections::GetProfileSelection(
  27. }
  28. #endif // BUILDFLAG(IS_CHROMEOS)
  29. +#if 0
  30. // Treat other off the record profiles as Incognito (primary otr) Profiles.
  31. if (profile->IsRegularProfile() || profile->IsIncognitoProfile() ||
  32. profile_metrics::GetBrowserProfileType(profile) ==
  33. @@ -148,6 +149,8 @@ ProfileSelection ProfileSelections::GetProfileSelection(
  34. }
  35. NOTREACHED();
  36. +#endif
  37. + return ProfileSelection::kNone;
  38. }
  39. void ProfileSelections::SetProfileSelectionForRegular(