Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: ios/web_view/internal/cwv_web_view_configuration.mm

Issue 2965303002: Expose method to reset translate settings. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web_view/internal/cwv_web_view_configuration.mm
diff --git a/ios/web_view/internal/cwv_web_view_configuration.mm b/ios/web_view/internal/cwv_web_view_configuration.mm
index d123fbf31269fb56a676e6837bc5750f6fc7caf5..52f18d79e63e6e59410c9b5ab7b8c2a741924f6c 100644
--- a/ios/web_view/internal/cwv_web_view_configuration.mm
+++ b/ios/web_view/internal/cwv_web_view_configuration.mm
@@ -7,9 +7,10 @@
#include "base/memory/ptr_util.h"
#include "base/threading/thread_restrictions.h"
-#include "components/translate/core/browser/translate_download_manager.h"
+#include "components/translate/core/browser/translate_prefs.h"
#include "ios/web_view/internal/app/application_context.h"
#import "ios/web_view/internal/cwv_user_content_controller_internal.h"
+#include "ios/web_view/internal/pref_names.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#include "ios/web_view/internal/web_view_global_state_util.h"
@@ -62,10 +63,20 @@
return self;
}
+#pragma mark - Public Methods
+
+- (void)resetTranslationPreferences {
+ translate::TranslatePrefs translatePrefs(_browserState->GetPrefs(),
+ prefs::kAcceptLanguages, nullptr);
+ translatePrefs.ResetToDefaults();
+}
+
- (BOOL)isPersistent {
return !_browserState->IsOffTheRecord();
}
+#pragma mark - Private Methods
+
- (ios_web_view::WebViewBrowserState*)browserState {
return _browserState.get();
}
« no previous file with comments | « no previous file | ios/web_view/public/cwv_web_view_configuration.h » ('j') | ios/web_view/public/cwv_web_view_configuration.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698