OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ui_delegate.h" | 5 #include "chrome/browser/translate/translate_ui_delegate.h" |
6 | 6 |
7 #include "base/i18n/string_compare.h" | 7 #include "base/i18n/string_compare.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/translate/translate_manager.h" | |
12 #include "chrome/browser/translate/translate_tab_helper.h" | 11 #include "chrome/browser/translate/translate_tab_helper.h" |
13 #include "components/translate/core/browser/translate_download_manager.h" | 12 #include "components/translate/core/browser/translate_download_manager.h" |
| 13 #include "components/translate/core/browser/translate_manager.h" |
14 #include "components/translate/core/browser/translate_prefs.h" | 14 #include "components/translate/core/browser/translate_prefs.h" |
15 #include "components/translate/core/common/translate_constants.h" | 15 #include "components/translate/core/common/translate_constants.h" |
16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/navigation_entry.h" | 17 #include "content/public/browser/navigation_entry.h" |
18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
19 #include "third_party/icu/source/i18n/unicode/coll.h" | 19 #include "third_party/icu/source/i18n/unicode/coll.h" |
20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 prefs_->RemoveLanguagePairFromWhitelist(original_lang, target_lang); | 250 prefs_->RemoveLanguagePairFromWhitelist(original_lang, target_lang); |
251 | 251 |
252 UMA_HISTOGRAM_BOOLEAN(kAlwaysTranslateLang, true); | 252 UMA_HISTOGRAM_BOOLEAN(kAlwaysTranslateLang, true); |
253 } | 253 } |
254 | 254 |
255 std::string TranslateUIDelegate::GetPageHost() { | 255 std::string TranslateUIDelegate::GetPageHost() { |
256 content::NavigationEntry* entry = | 256 content::NavigationEntry* entry = |
257 web_contents()->GetController().GetActiveEntry(); | 257 web_contents()->GetController().GetActiveEntry(); |
258 return entry ? entry->GetURL().HostNoBrackets() : std::string(); | 258 return entry ? entry->GetURL().HostNoBrackets() : std::string(); |
259 } | 259 } |
OLD | NEW |