OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_service.h" | 5 #include "chrome/browser/translate/translate_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } else { | 60 } else { |
61 // This path is only used by browser tests. | 61 // This path is only used by browser tests. |
62 download_manager->set_request_context(NULL); | 62 download_manager->set_request_context(NULL); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 // static | 66 // static |
67 void TranslateService::InitializeForTesting() { | 67 void TranslateService::InitializeForTesting() { |
68 if (!g_translate_service) { | 68 if (!g_translate_service) { |
69 TranslateService::Initialize(); | 69 TranslateService::Initialize(); |
| 70 translate::TranslateManager::SetIgnoreMissingKeyForTesting(true); |
70 } else { | 71 } else { |
71 translate::TranslateDownloadManager::GetInstance()->ResetForTesting(); | 72 translate::TranslateDownloadManager::GetInstance()->ResetForTesting(); |
72 g_translate_service->OnResourceRequestsAllowed(); | 73 g_translate_service->OnResourceRequestsAllowed(); |
73 } | 74 } |
74 } | 75 } |
75 | 76 |
76 // static | 77 // static |
77 void TranslateService::ShutdownForTesting() { | 78 void TranslateService::ShutdownForTesting() { |
78 translate::TranslateDownloadManager::GetInstance()->Shutdown(); | 79 translate::TranslateDownloadManager::GetInstance()->Shutdown(); |
79 } | 80 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // - an FTP page (as FTP pages tend to have long lists of filenames that may | 123 // - an FTP page (as FTP pages tend to have long lists of filenames that may |
123 // confuse the CLD) | 124 // confuse the CLD) |
124 return !url.is_empty() && !url.SchemeIs(content::kChromeUIScheme) && | 125 return !url.is_empty() && !url.SchemeIs(content::kChromeUIScheme) && |
125 !url.SchemeIs(content::kChromeDevToolsScheme) && | 126 !url.SchemeIs(content::kChromeDevToolsScheme) && |
126 #if defined(OS_CHROMEOS) | 127 #if defined(OS_CHROMEOS) |
127 !(url.SchemeIs(extensions::kExtensionScheme) && | 128 !(url.SchemeIs(extensions::kExtensionScheme) && |
128 url.DomainIs(file_manager::kFileManagerAppId)) && | 129 url.DomainIs(file_manager::kFileManagerAppId)) && |
129 #endif | 130 #endif |
130 !url.SchemeIs(url::kFtpScheme); | 131 !url.SchemeIs(url::kFtpScheme); |
131 } | 132 } |
OLD | NEW |