summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main.cc
diff options
context:
space:
mode:
authordroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-05 13:11:54 +0000
committerdroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-05 13:11:54 +0000
commit0bf9082d2bece5f81191a1e9cdb66af794157f21 (patch)
tree03bff4048c8d313aa45f4860fb8a898f8d6eae1a /chrome/browser/chrome_browser_main.cc
parent5275fc2c7edf6e680da8d296e0374adb9c5408b8 (diff)
downloadchromium_src-0bf9082d2bece5f81191a1e9cdb66af794157f21.zip
chromium_src-0bf9082d2bece5f81191a1e9cdb66af794157f21.tar.gz
chromium_src-0bf9082d2bece5f81191a1e9cdb66af794157f21.tar.bz2
Move TranslateLanguageList to the Translate component
A lot of static methods from TranslateManager are moved to TranslateDownloadManager, as they are related to the management of the TranslateLanguageList. The observer interface for translate events has been moved from TranslateManager to TranslateLanguageList. It also has been changed into a callback list rather than an observer list, since observers with a single method are generally discouraged. The SetSupportedLanguages() method in TranslateLanguageList has been moved from the anonymous namespace as it needs to invoke the callbacks for translate events. Finally, this CL fixes a bug where the TranslateList was not listening to ResourceRequestNotifications. BUG=335077, 335085, 339508 R=blundell@chromium.org, jochen@chromium.org, joi@chromium.org, mad@chromium.org TBR=jochen, joi, sky Review URL: https://codereview.chromium.org/143003020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main.cc')
-rw-r--r--chrome/browser/chrome_browser_main.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index f37ae25..ddf2bb8 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -91,7 +91,6 @@
#include "chrome/browser/profiles/profiles_state.h"
#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"
@@ -119,6 +118,7 @@
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/nacl_process_host.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
+#include "components/translate/core/browser/translate_download_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -1557,8 +1557,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
UMA_HISTOGRAM_LONG_TIMES_100("Startup.BrowserOpenTabs", delay);
// If we're running tests (ui_task is non-null), then we don't want to
- // call FetchLanguageListFromTranslateServer or
- // StartRepeatedVariationsSeedFetch.
+ // call RequestLanguageList or StartRepeatedVariationsSeedFetch.
if (parameters().ui_task == NULL) {
// Request new variations seed information from server.
chrome_variations::VariationsService* variations_service =
@@ -1571,8 +1570,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
#endif
}
- TranslateManager::GetInstance()->FetchLanguageListFromTranslateServer(
- profile_->GetPrefs());
+ TranslateDownloadManager::RequestLanguageList(profile_->GetPrefs());
}
run_message_loop_ = true;