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

Side by Side Diff: components/translate/core/browser/translate_url_util.cc

Issue 143003020: Move TranslateLanguageList to the Translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removeDelegate
Patch Set: rebase 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
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 "components/translate/core/browser/translate_url_util.h"
6 6
7 #include "chrome/browser/translate/translate_manager.h"
8 #include "components/translate/core/browser/translate_download_manager.h" 7 #include "components/translate/core/browser/translate_download_manager.h"
9 #include "google_apis/google_api_keys.h" 8 #include "google_apis/google_api_keys.h"
10 #include "net/base/url_util.h" 9 #include "net/base/url_util.h"
11 10
12 namespace { 11 namespace {
13 12
14 // Used in all translate URLs to specify API Key. 13 // Used in all translate URLs to specify API Key.
15 const char kApiKeyName[] = "key"; 14 const char kApiKeyName[] = "key";
16 15
17 // Used in kTranslateScriptURL and kLanguageListFetchURL to specify the 16 // Used in kTranslateScriptURL and kLanguageListFetchURL to specify the
18 // application locale. 17 // application locale.
19 const char kHostLocaleQueryName[] = "hl"; 18 const char kHostLocaleQueryName[] = "hl";
20 19
21 } // namespace 20 } // namespace
22 21
23 namespace TranslateURLUtil { 22 namespace TranslateURLUtil {
24 23
25 GURL AddApiKeyToUrl(const GURL& url) { 24 GURL AddApiKeyToUrl(const GURL& url) {
26 return net::AppendQueryParameter(url, kApiKeyName, google_apis::GetAPIKey()); 25 return net::AppendQueryParameter(url, kApiKeyName, google_apis::GetAPIKey());
27 } 26 }
28 27
29 GURL AddHostLocaleToUrl(const GURL& url) { 28 GURL AddHostLocaleToUrl(const GURL& url) {
30 return net::AppendQueryParameter( 29 return net::AppendQueryParameter(
31 url, 30 url,
32 kHostLocaleQueryName, 31 kHostLocaleQueryName,
33 TranslateManager::GetLanguageCode( 32 TranslateDownloadManager::GetLanguageCode(
34 TranslateDownloadManager::GetInstance()->application_locale())); 33 TranslateDownloadManager::GetInstance()->application_locale()));
35 } 34 }
36 35
37 } // namespace TranslateURLUtil 36 } // namespace TranslateURLUtil
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_url_util.h ('k') | components/translate/core/common/translate_pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698