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

Side by Side Diff: chrome/browser/translate/translate_manager.cc

Issue 219963007: Move Translate renderer messages to the Translate component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/translate/translate_manager.h" 5 #include "chrome/browser/translate/translate_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/translate/translate_tab_helper.h" 16 #include "chrome/browser/translate/translate_tab_helper.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/browser_tabstrip.h" 19 #include "chrome/browser/ui/browser_tabstrip.h"
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" 20 #include "chrome/browser/ui/tabs/tab_strip_model.h"
21 #include "chrome/common/render_messages.h"
22 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
22 #include "components/translate/content/common/translate_messages.h"
23 #include "components/translate/core/browser/language_state.h" 23 #include "components/translate/core/browser/language_state.h"
24 #include "components/translate/core/browser/page_translated_details.h" 24 #include "components/translate/core/browser/page_translated_details.h"
25 #include "components/translate/core/browser/translate_accept_languages.h" 25 #include "components/translate/core/browser/translate_accept_languages.h"
26 #include "components/translate/core/browser/translate_browser_metrics.h" 26 #include "components/translate/core/browser/translate_browser_metrics.h"
27 #include "components/translate/core/browser/translate_client.h" 27 #include "components/translate/core/browser/translate_client.h"
28 #include "components/translate/core/browser/translate_download_manager.h" 28 #include "components/translate/core/browser/translate_download_manager.h"
29 #include "components/translate/core/browser/translate_driver.h" 29 #include "components/translate/core/browser/translate_driver.h"
30 #include "components/translate/core/browser/translate_error_details.h" 30 #include "components/translate/core/browser/translate_error_details.h"
31 #include "components/translate/core/browser/translate_language_list.h" 31 #include "components/translate/core/browser/translate_language_list.h"
32 #include "components/translate/core/browser/translate_prefs.h" 32 #include "components/translate/core/browser/translate_prefs.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 &auto_target_lang)) { 581 &auto_target_lang)) {
582 // We need to confirm that the saved target language is still supported. 582 // We need to confirm that the saved target language is still supported.
583 // Also, GetLanguageCode will take care of removing country code if any. 583 // Also, GetLanguageCode will take care of removing country code if any.
584 auto_target_lang = 584 auto_target_lang =
585 TranslateDownloadManager::GetLanguageCode(auto_target_lang); 585 TranslateDownloadManager::GetLanguageCode(auto_target_lang);
586 if (TranslateDownloadManager::IsSupportedLanguage(auto_target_lang)) 586 if (TranslateDownloadManager::IsSupportedLanguage(auto_target_lang))
587 return auto_target_lang; 587 return auto_target_lang;
588 } 588 }
589 return std::string(); 589 return std::string();
590 } 590 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698