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

Unified Diff: chrome/browser/translate/translate_service.cc

Issue 145023015: Introduce TranslateService and TranslateDownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest Created 6 years, 11 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 | « chrome/browser/translate/translate_service.h ('k') | chrome/browser/translate/translate_url_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_service.cc
diff --git a/chrome/browser/translate/translate_service.cc b/chrome/browser/translate/translate_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8bc6922eb88c3381907ec7afbf38c1ffed2caf77
--- /dev/null
+++ b/chrome/browser/translate/translate_service.cc
@@ -0,0 +1,28 @@
+// 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 "chrome/browser/translate/translate_service.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/translate/translate_manager.h"
+#include "components/translate/core/browser/translate_download_manager.h"
+
+// static
+void TranslateService::Initialize() {
+ // Create the TranslateManager singleton.
+ TranslateManager::GetInstance();
+ TranslateDownloadManager* download_manager =
+ TranslateDownloadManager::GetInstance();
+ download_manager->set_request_context(
+ g_browser_process->system_request_context());
+ download_manager->set_application_locale(
+ g_browser_process->GetApplicationLocale());
+}
+
+// static
+void TranslateService::Shutdown(bool cleanup_pending_fetcher) {
+ if (cleanup_pending_fetcher)
+ TranslateManager::GetInstance()->CleanupPendingUlrFetcher();
+ TranslateDownloadManager::GetInstance()->set_request_context(NULL);
+}
« no previous file with comments | « chrome/browser/translate/translate_service.h ('k') | chrome/browser/translate/translate_url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698