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

Side by Side Diff: ios/web_view/internal/cwv_browser_state.mm

Issue 2713243002: Rename CRIWVURLRequestContextGetter prefix. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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/cwv_browser_state.h" 5 #include "ios/web_view/internal/cwv_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/cwv_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) 25 #if !defined(__has_feature) || !__has_feature(objc_arc)
26 #error "This file requires ARC support." 26 #error "This file requires ARC support."
27 #endif 27 #endif
28 28
29 namespace { 29 namespace {
30 const char kPreferencesFilename[] = FILE_PATH_LITERAL("Preferences"); 30 const char kPreferencesFilename[] = FILE_PATH_LITERAL("Preferences");
31 } 31 }
32 32
33 namespace ios_web_view { 33 namespace ios_web_view {
34 34
35 CWVBrowserState::CWVBrowserState(bool off_the_record) 35 CWVBrowserState::CWVBrowserState(bool off_the_record)
36 : web::BrowserState(), off_the_record_(off_the_record) { 36 : web::BrowserState(), off_the_record_(off_the_record) {
37 CHECK(PathService::Get(base::DIR_APP_DATA, &path_)); 37 CHECK(PathService::Get(base::DIR_APP_DATA, &path_));
38 38
39 request_context_getter_ = new CRIWVURLRequestContextGetter( 39 request_context_getter_ = new CWVURLRequestContextGetter(
40 GetStatePath(), 40 GetStatePath(),
41 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), 41 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
42 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), 42 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE),
43 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE)); 43 web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE));
44 44
45 // Initialize prefs. 45 // Initialize prefs.
46 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry = 46 scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry =
47 new user_prefs::PrefRegistrySyncable; 47 new user_prefs::PrefRegistrySyncable;
48 RegisterPrefs(pref_registry.get()); 48 RegisterPrefs(pref_registry.get());
49 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner = 49 scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner =
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // 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.
89 // 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
90 // the HTTP header. 90 // the HTTP header.
91 pref_registry->RegisterStringPref(prefs::kAcceptLanguages, 91 pref_registry->RegisterStringPref(prefs::kAcceptLanguages,
92 l10n_util::GetLocaleOverride()); 92 l10n_util::GetLocaleOverride());
93 pref_registry->RegisterBooleanPref(prefs::kEnableTranslate, true); 93 pref_registry->RegisterBooleanPref(prefs::kEnableTranslate, true);
94 translate::TranslatePrefs::RegisterProfilePrefs(pref_registry); 94 translate::TranslatePrefs::RegisterProfilePrefs(pref_registry);
95 } 95 }
96 96
97 } // namespace ios_web_view 97 } // namespace ios_web_view
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698