Index: ios/web_view/internal/translate/cwv_translation_controller.mm |
diff --git a/ios/web_view/internal/translate/cwv_translation_controller.mm b/ios/web_view/internal/translate/cwv_translation_controller.mm |
index c62a8680ebdcd0ba3acbb29eda254f5df42185f6..25a65aac0696dfb837b452c457bcb693a1e2a831 100644 |
--- a/ios/web_view/internal/translate/cwv_translation_controller.mm |
+++ b/ios/web_view/internal/translate/cwv_translation_controller.mm |
@@ -11,8 +11,11 @@ |
#include "base/strings/sys_string_conversions.h" |
#include "components/translate/core/browser/translate_download_manager.h" |
#include "components/translate/core/browser/translate_manager.h" |
+#import "ios/web_view/internal/cwv_web_view_configuration_internal.h" |
+#include "ios/web_view/internal/pref_names.h" |
#import "ios/web_view/internal/translate/cwv_translation_language_internal.h" |
#import "ios/web_view/internal/translate/web_view_translate_client.h" |
+#include "ios/web_view/internal/web_view_browser_state.h" |
#import "ios/web_view/public/cwv_translation_controller_delegate.h" |
#import "ios/web_view/public/cwv_translation_policy.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -65,6 +68,17 @@ const NSInteger CWVTranslationErrorScriptLoadError = |
@synthesize supportedLanguagesByCode = _supportedLanguagesByCode; |
@synthesize webState = _webState; |
+#pragma mark - Class Methods |
+ |
++ (void)resetTranslationPolicies { |
+ CWVWebViewConfiguration* configuration = |
+ [CWVWebViewConfiguration defaultConfiguration]; |
+ PrefService* prefService = configuration.browserState->GetPrefs(); |
+ translate::TranslatePrefs translatePrefs(prefService, prefs::kAcceptLanguages, |
+ nullptr); |
+ translatePrefs.ResetToDefaults(); |
+} |
+ |
#pragma mark - Internal Methods |
- (void)setWebState:(web::WebState*)webState { |