Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: chrome/browser/translate/translate_manager.cc

Issue 9320015: When translating a page, get the code and translation via HTTPS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 const char* const code_2; 143 const char* const code_2;
144 }; 144 };
145 145
146 const LanguageCodeSynonym kLanguageCodeSynonyms[] = { 146 const LanguageCodeSynonym kLanguageCodeSynonyms[] = {
147 {"no", "nb"}, 147 {"no", "nb"},
148 {"iw", "he"}, 148 {"iw", "he"},
149 {"jw", "jv"}, 149 {"jw", "jv"},
150 }; 150 };
151 151
152 const char* const kTranslateScriptURL = 152 const char* const kTranslateScriptURL =
153 "http://translate.google.com/translate_a/element.js?" 153 "https://translate.google.com/translate_a/element.js?"
154 "cb=cr.googleTranslate.onTranslateElementLoad"; 154 "cb=cr.googleTranslate.onTranslateElementLoad";
155 const char* const kTranslateScriptHeader = 155 const char* const kTranslateScriptHeader =
156 "Google-Translate-Element-Mode: library"; 156 "Google-Translate-Element-Mode: library";
157 const char* const kReportLanguageDetectionErrorURL = 157 const char* const kReportLanguageDetectionErrorURL =
158 // TODO(palmer): bug 112236. Make this https://.
158 "http://translate.google.com/translate_error"; 159 "http://translate.google.com/translate_error";
159 const char* const kLanguageListFetchURL = 160 const char* const kLanguageListFetchURL =
160 "http://translate.googleapis.com/translate_a/l?client=chrome&cb=sl"; 161 "https://translate.googleapis.com/translate_a/l?client=chrome&cb=sl";
161 const int kMaxRetryLanguageListFetch = 5; 162 const int kMaxRetryLanguageListFetch = 5;
162 const int kTranslateScriptExpirationDelayDays = 1; 163 const int kTranslateScriptExpirationDelayDays = 1;
163 164
164 } // namespace 165 } // namespace
165 166
166 // This must be kept in sync with the &cb= value in the kLanguageListFetchURL. 167 // This must be kept in sync with the &cb= value in the kLanguageListFetchURL.
167 const char* const TranslateManager::kLanguageListCallbackName = "sl("; 168 const char* const TranslateManager::kLanguageListCallbackName = "sl(";
168 const char* const TranslateManager::kTargetLanguagesKey = "tl"; 169 const char* const TranslateManager::kTargetLanguagesKey = "tl";
169 170
170 // static 171 // static
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper(); 874 InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper();
874 875
875 for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) { 876 for (size_t i = 0; i < infobar_helper->infobar_count(); ++i) {
876 TranslateInfoBarDelegate* delegate = 877 TranslateInfoBarDelegate* delegate =
877 infobar_helper->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate(); 878 infobar_helper->GetInfoBarDelegateAt(i)->AsTranslateInfoBarDelegate();
878 if (delegate) 879 if (delegate)
879 return delegate; 880 return delegate;
880 } 881 }
881 return NULL; 882 return NULL;
882 } 883 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698