| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/translate/translate_service.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/translate/translate_manager.h" |
| 9 #include "components/translate/core/browser/translate_download_manager.h" |
| 10 |
| 11 // static |
| 12 void TranslateService::Initialize() { |
| 13 // Create the TranslateManager singleton. |
| 14 TranslateManager::GetInstance(); |
| 15 TranslateDownloadManager* download_manager = |
| 16 TranslateDownloadManager::GetInstance(); |
| 17 download_manager->set_request_context( |
| 18 g_browser_process->system_request_context()); |
| 19 download_manager->set_application_locale( |
| 20 g_browser_process->GetApplicationLocale()); |
| 21 } |
| 22 |
| 23 // static |
| 24 void TranslateService::Shutdown(bool cleanup_pending_fetcher) { |
| 25 if (cleanup_pending_fetcher) |
| 26 TranslateManager::GetInstance()->CleanupPendingUlrFetcher(); |
| 27 TranslateDownloadManager::GetInstance()->set_request_context(NULL); |
| 28 } |
| OLD | NEW |