| 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 #import "ios/web_view/internal/criwv_web_main_parts.h" | 5 #import "ios/web_view/internal/criwv_web_main_parts.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "components/translate/core/browser/translate_download_manager.h" | 10 #include "components/translate/core/browser/translate_download_manager.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Initialize resources. | 25 // Initialize resources. |
| 26 l10n_util::OverrideLocaleWithCocoaLocale(); | 26 l10n_util::OverrideLocaleWithCocoaLocale(); |
| 27 ui::ResourceBundle::InitSharedInstanceWithLocale( | 27 ui::ResourceBundle::InitSharedInstanceWithLocale( |
| 28 std::string(), nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); | 28 std::string(), nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); |
| 29 base::FilePath pak_file; | 29 base::FilePath pak_file; |
| 30 PathService::Get(base::DIR_MODULE, &pak_file); | 30 PathService::Get(base::DIR_MODULE, &pak_file); |
| 31 pak_file = pak_file.Append(FILE_PATH_LITERAL("web_view_resources.pak")); | 31 pak_file = pak_file.Append(FILE_PATH_LITERAL("web_view_resources.pak")); |
| 32 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 32 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 33 pak_file, ui::SCALE_FACTOR_NONE); | 33 pak_file, ui::SCALE_FACTOR_NONE); |
| 34 | 34 |
| 35 browser_state_ = base::MakeUnique<CRIWVBrowserState>(); | 35 browser_state_ = base::MakeUnique<CRIWVBrowserState>(false); |
| 36 off_the_record_browser_state_ = base::MakeUnique<CRIWVBrowserState>(true); |
| 36 | 37 |
| 37 // Initialize translate. | 38 // Initialize translate. |
| 38 translate::TranslateDownloadManager* download_manager = | 39 translate::TranslateDownloadManager* download_manager = |
| 39 translate::TranslateDownloadManager::GetInstance(); | 40 translate::TranslateDownloadManager::GetInstance(); |
| 40 // TODO(crbug.com/679895): See if we need the system request context here. | 41 // TODO(crbug.com/679895): See if we need the system request context here. |
| 41 download_manager->set_request_context(browser_state_->GetRequestContext()); | 42 download_manager->set_request_context(browser_state_->GetRequestContext()); |
| 42 // TODO(crbug.com/679895): Bring up application locale correctly. | 43 // TODO(crbug.com/679895): Bring up application locale correctly. |
| 43 download_manager->set_application_locale(l10n_util::GetLocaleOverride()); | 44 download_manager->set_application_locale(l10n_util::GetLocaleOverride()); |
| 44 download_manager->language_list()->SetResourceRequestsAllowed(true); | 45 download_manager->language_list()->SetResourceRequestsAllowed(true); |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace ios_web_view | 48 } // namespace ios_web_view |
| OLD | NEW |