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

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

Issue 2715043002: Replace prefix of ios/web_view C++ classes. (Closed)
Patch Set: Respond to comments. Created 3 years, 10 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
« no previous file with comments | « ios/web_view/internal/criwv_browser_state.h ('k') | ios/web_view/internal/criwv_network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/criwv_browser_state.mm
diff --git a/ios/web_view/internal/criwv_browser_state.mm b/ios/web_view/internal/criwv_browser_state.mm
deleted file mode 100644
index d581ab985ac4db67be84726f0ce4d77cc2d53ae7..0000000000000000000000000000000000000000
--- a/ios/web_view/internal/criwv_browser_state.mm
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ios/web_view/internal/criwv_browser_state.h"
-
-#include <memory>
-
-#include "base/base_paths.h"
-#include "base/files/file_path.h"
-#include "base/message_loop/message_loop.h"
-#include "base/path_service.h"
-#include "base/threading/thread_restrictions.h"
-#include "components/pref_registry/pref_registry_syncable.h"
-#include "components/prefs/json_pref_store.h"
-#include "components/prefs/pref_filter.h"
-#include "components/prefs/pref_service_factory.h"
-#include "components/translate/core/browser/translate_prefs.h"
-#include "components/translate/core/common/translate_pref_names.h"
-#include "ios/web/public/web_thread.h"
-#include "ios/web_view/internal/criwv_url_request_context_getter.h"
-#include "ios/web_view/internal/pref_names.h"
-#include "ui/base/l10n/l10n_util_mac.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-const char kPreferencesFilename[] = FILE_PATH_LITERAL("Preferences");
-}
-
-namespace ios_web_view {
-
-CRIWVBrowserState::CRIWVBrowserState(bool off_the_record)
- : web::BrowserState(), off_the_record_(off_the_record) {
- CHECK(PathService::Get(base::DIR_APP_DATA, &path_));
-
- request_context_getter_ = new CRIWVURLRequestContextGetter(
- GetStatePath(),
- web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
- web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE),
- web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE));
-
- // Initialize prefs.
- scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry =
- new user_prefs::PrefRegistrySyncable;
- RegisterPrefs(pref_registry.get());
- scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner =
- JsonPrefStore::GetTaskRunnerForFile(path_,
- web::WebThread::GetBlockingPool());
-
- scoped_refptr<PersistentPrefStore> user_pref_store = new JsonPrefStore(
- path_.Append(kPreferencesFilename), sequenced_task_runner, nullptr);
-
- PrefServiceFactory factory;
- factory.set_user_prefs(user_pref_store);
- prefs_ = factory.Create(pref_registry.get());
-}
-
-CRIWVBrowserState::~CRIWVBrowserState() {}
-
-PrefService* CRIWVBrowserState::GetPrefs() {
- DCHECK(prefs_);
- return prefs_.get();
-}
-
-// static
-CRIWVBrowserState* CRIWVBrowserState::FromBrowserState(
- web::BrowserState* browser_state) {
- return static_cast<CRIWVBrowserState*>(browser_state);
-}
-
-bool CRIWVBrowserState::IsOffTheRecord() const {
- return off_the_record_;
-}
-
-base::FilePath CRIWVBrowserState::GetStatePath() const {
- return path_;
-}
-
-net::URLRequestContextGetter* CRIWVBrowserState::GetRequestContext() {
- return request_context_getter_.get();
-}
-
-void CRIWVBrowserState::RegisterPrefs(
- user_prefs::PrefRegistrySyncable* pref_registry) {
- // TODO(crbug.com/679895): Find a good value for the kAcceptLanguages pref.
- // TODO(crbug.com/679895): Pass this value to the network stack somehow, for
- // the HTTP header.
- pref_registry->RegisterStringPref(prefs::kAcceptLanguages,
- l10n_util::GetLocaleOverride());
- pref_registry->RegisterBooleanPref(prefs::kEnableTranslate, true);
- translate::TranslatePrefs::RegisterProfilePrefs(pref_registry);
-}
-
-} // namespace ios_web_view
« no previous file with comments | « ios/web_view/internal/criwv_browser_state.h ('k') | ios/web_view/internal/criwv_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698