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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 145023015: Introduce TranslateService and TranslateDownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browsertests 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
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 77205a8c97e539fc6b92b53d3abf86c594c3c806..c78b816ba221a84c5c0d42d556b67ff4ad492638 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -91,6 +91,7 @@
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/three_d_api_observer.h"
#include "chrome/browser/translate/translate_manager.h"
+#include "chrome/browser/translate/translate_service.h"
#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -535,7 +536,6 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
shutdown_watcher_(new ShutdownWatcherHelper()),
startup_timer_(new performance_monitor::StartupTimer()),
browser_field_trials_(parameters.command_line),
- translate_manager_(NULL),
profile_(NULL),
run_message_loop_(true),
notify_result_(ProcessSingleton::PROCESS_NONE),
@@ -1266,9 +1266,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS;
#endif
- // Create the TranslateManager singleton.
- translate_manager_ = TranslateManager::GetInstance();
- DCHECK(translate_manager_ != NULL);
+ TranslateService::Initialize();
// Needs to be done before PostProfileInit, since login manager on CrOS is
// called inside PostProfileInit.
@@ -1549,10 +1547,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
#endif
}
- if (translate_manager_ != NULL) {
- translate_manager_->FetchLanguageListFromTranslateServer(
- profile_->GetPrefs());
- }
+ TranslateManager::GetInstance()->FetchLanguageListFromTranslateServer(
blundell 2014/01/24 17:52:43 So this will become a call on TranslateDownloadMan
droger 2014/01/27 14:13:43 Yes.
+ profile_->GetPrefs());
}
run_message_loop_ = true;
@@ -1645,8 +1641,7 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() {
// Some tests don't set parameters.ui_task, so they started translate
// language fetch that was never completed so we need to cleanup here
// otherwise it will be done by the destructor in a wrong thread.
- if (parameters().ui_task == NULL && translate_manager_ != NULL)
- translate_manager_->CleanupPendingUlrFetcher();
+ TranslateService::Shutdown(parameters().ui_task == NULL);
if (notify_result_ == ProcessSingleton::PROCESS_NONE)
process_singleton_->Cleanup();

Powered by Google App Engine
This is Rietveld 408576698