| OLD | NEW |
| 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/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // static | 97 // static |
| 98 bool TranslateManager::IsTranslatableURL(const GURL& url) { | 98 bool TranslateManager::IsTranslatableURL(const GURL& url) { |
| 99 // A URLs is translatable unless it is one of the following: | 99 // A URLs is translatable unless it is one of the following: |
| 100 // - empty (can happen for popups created with window.open("")) | 100 // - empty (can happen for popups created with window.open("")) |
| 101 // - an internal URL (chrome:// and others) | 101 // - an internal URL (chrome:// and others) |
| 102 // - the devtools (which is considered UI) | 102 // - the devtools (which is considered UI) |
| 103 // - Chrome OS file manager extension | 103 // - Chrome OS file manager extension |
| 104 // - an FTP page (as FTP pages tend to have long lists of filenames that may | 104 // - an FTP page (as FTP pages tend to have long lists of filenames that may |
| 105 // confuse the CLD) | 105 // confuse the CLD) |
| 106 return !url.is_empty() && | 106 return !url.is_empty() && |
| 107 !url.SchemeIs(chrome::kChromeUIScheme) && | 107 !url.SchemeIs(content::kChromeUIScheme) && |
| 108 !url.SchemeIs(chrome::kChromeDevToolsScheme) && | 108 !url.SchemeIs(chrome::kChromeDevToolsScheme) && |
| 109 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
| 110 !(url.SchemeIs(extensions::kExtensionScheme) && | 110 !(url.SchemeIs(extensions::kExtensionScheme) && |
| 111 url.DomainIs(file_manager::kFileManagerAppId)) && | 111 url.DomainIs(file_manager::kFileManagerAppId)) && |
| 112 #endif | 112 #endif |
| 113 !url.SchemeIs(content::kFtpScheme); | 113 !url.SchemeIs(content::kFtpScheme); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // static | 116 // static |
| 117 bool TranslateManager::IsAcceptLanguage(Profile* profile, | 117 bool TranslateManager::IsAcceptLanguage(Profile* profile, |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // so we are more aggressive about showing the shortcut to never translate. | 739 // so we are more aggressive about showing the shortcut to never translate. |
| 740 #if defined(OS_ANDROID) | 740 #if defined(OS_ANDROID) |
| 741 config.never_translate_min_count = 1; | 741 config.never_translate_min_count = 1; |
| 742 #else | 742 #else |
| 743 config.never_translate_min_count = 3; | 743 config.never_translate_min_count = 3; |
| 744 #endif // defined(OS_ANDROID) | 744 #endif // defined(OS_ANDROID) |
| 745 | 745 |
| 746 config.always_translate_min_count = 3; | 746 config.always_translate_min_count = 3; |
| 747 return config; | 747 return config; |
| 748 } | 748 } |
| OLD | NEW |