| 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_script.h" | 5 #include "components/translate/core/browser/translate_script.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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace translate { | 28 namespace translate { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 const int kExpirationDelayDays = 1; | 32 const int kExpirationDelayDays = 1; |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 const char TranslateScript::kScriptURL[] = | 36 const char TranslateScript::kScriptURL[] = |
| 37 "https://translate.google.com/translate_a/element.js"; | 37 "https://translate.googleapis.com/translate_a/element.js"; |
| 38 const char TranslateScript::kRequestHeader[] = | 38 const char TranslateScript::kRequestHeader[] = |
| 39 "Google-Translate-Element-Mode: library"; | 39 "Google-Translate-Element-Mode: library"; |
| 40 const char TranslateScript::kAlwaysUseSslQueryName[] = "aus"; | 40 const char TranslateScript::kAlwaysUseSslQueryName[] = "aus"; |
| 41 const char TranslateScript::kAlwaysUseSslQueryValue[] = "true"; | 41 const char TranslateScript::kAlwaysUseSslQueryValue[] = "true"; |
| 42 const char TranslateScript::kCallbackQueryName[] = "cb"; | 42 const char TranslateScript::kCallbackQueryName[] = "cb"; |
| 43 const char TranslateScript::kCallbackQueryValue[] = | 43 const char TranslateScript::kCallbackQueryValue[] = |
| 44 "cr.googleTranslate.onTranslateElementLoad"; | 44 "cr.googleTranslate.onTranslateElementLoad"; |
| 45 const char TranslateScript::kCssLoaderCallbackQueryName[] = "clc"; | 45 const char TranslateScript::kCssLoaderCallbackQueryName[] = "clc"; |
| 46 const char TranslateScript::kCssLoaderCallbackQueryValue[] = | 46 const char TranslateScript::kCssLoaderCallbackQueryValue[] = |
| 47 "cr.googleTranslate.onLoadCSS"; | 47 "cr.googleTranslate.onLoadCSS"; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 for (RequestCallbackList::iterator it = callback_list_.begin(); | 154 for (RequestCallbackList::iterator it = callback_list_.begin(); |
| 155 it != callback_list_.end(); | 155 it != callback_list_.end(); |
| 156 ++it) { | 156 ++it) { |
| 157 it->Run(success, data); | 157 it->Run(success, data); |
| 158 } | 158 } |
| 159 callback_list_.clear(); | 159 callback_list_.clear(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace translate | 162 } // namespace translate |
| OLD | NEW |