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" |
11 #include "components/translate/core/common/translate_pref_names.h" | 11 #include "components/translate/core/common/translate_pref_names.h" |
12 #include "components/translate/core/common/translate_switches.h" | 12 #include "components/translate/core/common/translate_switches.h" |
13 | 13 |
| 14 namespace translate { |
| 15 |
14 // static | 16 // static |
15 TranslateDownloadManager* TranslateDownloadManager::GetInstance() { | 17 TranslateDownloadManager* TranslateDownloadManager::GetInstance() { |
16 return Singleton<TranslateDownloadManager>::get(); | 18 return Singleton<TranslateDownloadManager>::get(); |
17 } | 19 } |
18 | 20 |
19 TranslateDownloadManager::TranslateDownloadManager() | 21 TranslateDownloadManager::TranslateDownloadManager() |
20 : language_list_(new TranslateLanguageList), | 22 : language_list_(new TranslateLanguageList), |
21 script_(new TranslateScript) {} | 23 script_(new TranslateScript) {} |
22 | 24 |
23 TranslateDownloadManager::~TranslateDownloadManager() {} | 25 TranslateDownloadManager::~TranslateDownloadManager() {} |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 script_.reset(new TranslateScript); | 125 script_.reset(new TranslateScript); |
124 } | 126 } |
125 | 127 |
126 void TranslateDownloadManager::SetTranslateScriptExpirationDelay(int delay_ms) { | 128 void TranslateDownloadManager::SetTranslateScriptExpirationDelay(int delay_ms) { |
127 if (script_.get() == NULL) { | 129 if (script_.get() == NULL) { |
128 NOTREACHED(); | 130 NOTREACHED(); |
129 return; | 131 return; |
130 } | 132 } |
131 script_->set_expiration_delay(delay_ms); | 133 script_->set_expiration_delay(delay_ms); |
132 } | 134 } |
| 135 |
| 136 } // namespace translate |
OLD | NEW |