remove_usage_of_incognito_apis_in_the_spellchecker.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 a4e6a26e6ce757092771b747be76135deb84cf4a..8444b1666261e46d1509e1941a6ba5cb10c91edd 100644
  24. --- a/chrome/browser/profiles/profile_selections.cc
  25. +++ b/chrome/browser/profiles/profile_selections.cc
  26. @@ -123,6 +123,7 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const {
  27. ProfileSelection ProfileSelections::GetProfileSelection(
  28. Profile* profile) const {
  29. +#if 0
  30. #if BUILDFLAG(IS_CHROMEOS_ASH)
  31. // This check has to be performed before the check on
  32. // `profile->IsRegularProfile()` because profiles that are internal ASH
  33. @@ -148,6 +149,7 @@ ProfileSelection ProfileSelections::GetProfileSelection(
  34. }
  35. NOTREACHED_IN_MIGRATION();
  36. +#endif
  37. return ProfileSelection::kNone;
  38. }