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

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

Issue 145023015: Introduce TranslateService and TranslateDownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittest Created 6 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
« no previous file with comments | « chrome/browser/translate/translate_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_url_util.h" 5 #include "chrome/browser/translate/translate_url_util.h"
6 6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/translate/translate_manager.h" 7 #include "chrome/browser/translate/translate_manager.h"
8 #include "components/translate/core/browser/translate_download_manager.h"
9 #include "google_apis/google_api_keys.h" 9 #include "google_apis/google_api_keys.h"
10 #include "net/base/url_util.h" 10 #include "net/base/url_util.h"
11 11
12 namespace { 12 namespace {
13 13
14 // Used in all translate URLs to specify API Key. 14 // Used in all translate URLs to specify API Key.
15 const char kApiKeyName[] = "key"; 15 const char kApiKeyName[] = "key";
16 16
17 // Used in kTranslateScriptURL and kLanguageListFetchURL to specify the 17 // Used in kTranslateScriptURL and kLanguageListFetchURL to specify the
18 // application locale. 18 // application locale.
19 const char kHostLocaleQueryName[] = "hl"; 19 const char kHostLocaleQueryName[] = "hl";
20 20
21 } // namespace 21 } // namespace
22 22
23 namespace TranslateURLUtil { 23 namespace TranslateURLUtil {
24 24
25 GURL AddApiKeyToUrl(const GURL& url) { 25 GURL AddApiKeyToUrl(const GURL& url) {
26 return net::AppendQueryParameter(url, kApiKeyName, google_apis::GetAPIKey()); 26 return net::AppendQueryParameter(url, kApiKeyName, google_apis::GetAPIKey());
27 } 27 }
28 28
29 GURL AddHostLocaleToUrl(const GURL& url) { 29 GURL AddHostLocaleToUrl(const GURL& url) {
30 return net::AppendQueryParameter( 30 return net::AppendQueryParameter(
31 url, 31 url,
32 kHostLocaleQueryName, 32 kHostLocaleQueryName,
33 TranslateManager::GetLanguageCode( 33 TranslateManager::GetLanguageCode(
34 g_browser_process->GetApplicationLocale())); 34 TranslateDownloadManager::GetInstance()->application_locale()));
35 } 35 }
36 36
37 } // namespace TranslateURLUtil 37 } // namespace TranslateURLUtil
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_service.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698