| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/web_view/internal/criwv_browser_state.h" | 5 #include "ios/web_view/internal/criwv_browser_state.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "components/pref_registry/pref_registry_syncable.h" | 14 #include "components/pref_registry/pref_registry_syncable.h" |
| 15 #include "components/prefs/json_pref_store.h" | 15 #include "components/prefs/json_pref_store.h" |
| 16 #include "components/prefs/pref_filter.h" | 16 #include "components/prefs/pref_filter.h" |
| 17 #include "components/prefs/pref_service_factory.h" | 17 #include "components/prefs/pref_service_factory.h" |
| 18 #include "components/translate/core/browser/translate_prefs.h" | 18 #include "components/translate/core/browser/translate_prefs.h" |
| 19 #include "components/translate/core/common/translate_pref_names.h" | 19 #include "components/translate/core/common/translate_pref_names.h" |
| 20 #include "ios/web/public/web_thread.h" | 20 #include "ios/web/public/web_thread.h" |
| 21 #include "ios/web_view/internal/criwv_url_request_context_getter.h" | 21 #include "ios/web_view/internal/criwv_url_request_context_getter.h" |
| 22 #include "ios/web_view/internal/pref_names.h" | 22 #include "ios/web_view/internal/pref_names.h" |
| 23 #include "ui/base/l10n/l10n_util_mac.h" | 23 #include "ui/base/l10n/l10n_util_mac.h" |
| 24 | 24 |
| 25 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 26 #error "This file requires ARC support." |
| 27 #endif |
| 28 |
| 25 namespace { | 29 namespace { |
| 26 const char kPreferencesFilename[] = FILE_PATH_LITERAL("Preferences"); | 30 const char kPreferencesFilename[] = FILE_PATH_LITERAL("Preferences"); |
| 27 } | 31 } |
| 28 | 32 |
| 29 namespace ios_web_view { | 33 namespace ios_web_view { |
| 30 | 34 |
| 31 CRIWVBrowserState::CRIWVBrowserState(bool off_the_record) | 35 CRIWVBrowserState::CRIWVBrowserState(bool off_the_record) |
| 32 : web::BrowserState(), off_the_record_(off_the_record) { | 36 : web::BrowserState(), off_the_record_(off_the_record) { |
| 33 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); | 37 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); |
| 34 | 38 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // TODO(crbug.com/679895): Find a good value for the kAcceptLanguages pref. | 88 // TODO(crbug.com/679895): Find a good value for the kAcceptLanguages pref. |
| 85 // TODO(crbug.com/679895): Pass this value to the network stack somehow, for | 89 // TODO(crbug.com/679895): Pass this value to the network stack somehow, for |
| 86 // the HTTP header. | 90 // the HTTP header. |
| 87 pref_registry->RegisterStringPref(prefs::kAcceptLanguages, | 91 pref_registry->RegisterStringPref(prefs::kAcceptLanguages, |
| 88 l10n_util::GetLocaleOverride()); | 92 l10n_util::GetLocaleOverride()); |
| 89 pref_registry->RegisterBooleanPref(prefs::kEnableTranslate, true); | 93 pref_registry->RegisterBooleanPref(prefs::kEnableTranslate, true); |
| 90 translate::TranslatePrefs::RegisterProfilePrefs(pref_registry); | 94 translate::TranslatePrefs::RegisterProfilePrefs(pref_registry); |
| 91 } | 95 } |
| 92 | 96 |
| 93 } // namespace ios_web_view | 97 } // namespace ios_web_view |
| OLD | NEW |