| 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 "components/translate/core/browser/translate_download_manager.h" | 5 #include "components/translate/core/browser/translate_download_manager.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/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 void TranslateDownloadManager::ClearTranslateScriptForTesting() { | 113 void TranslateDownloadManager::ClearTranslateScriptForTesting() { |
| 114 if (script_.get() == NULL) { | 114 if (script_.get() == NULL) { |
| 115 NOTREACHED(); | 115 NOTREACHED(); |
| 116 return; | 116 return; |
| 117 } | 117 } |
| 118 script_->Clear(); | 118 script_->Clear(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void TranslateDownloadManager::ResetForTesting() { |
| 122 language_list_.reset(new TranslateLanguageList); |
| 123 script_.reset(new TranslateScript); |
| 124 } |
| 125 |
| 121 void TranslateDownloadManager::SetTranslateScriptExpirationDelay(int delay_ms) { | 126 void TranslateDownloadManager::SetTranslateScriptExpirationDelay(int delay_ms) { |
| 122 if (script_.get() == NULL) { | 127 if (script_.get() == NULL) { |
| 123 NOTREACHED(); | 128 NOTREACHED(); |
| 124 return; | 129 return; |
| 125 } | 130 } |
| 126 script_->set_expiration_delay(delay_ms); | 131 script_->set_expiration_delay(delay_ms); |
| 127 } | 132 } |
| OLD | NEW |