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 "chrome/browser/update_client/chrome_update_query_params_delegate.h" | 5 #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 std::string ChromeUpdateQueryParamsDelegate::GetExtraParams() { | 37 std::string ChromeUpdateQueryParamsDelegate::GetExtraParams() { |
38 return base::StringPrintf("&prodchannel=%s&prodversion=%s&lang=%s", | 38 return base::StringPrintf("&prodchannel=%s&prodversion=%s&lang=%s", |
39 GetChannelString(), | 39 GetChannelString(), |
40 chrome::VersionInfo().Version().c_str(), GetLang()); | 40 chrome::VersionInfo().Version().c_str(), GetLang()); |
41 } | 41 } |
42 | 42 |
43 // static | 43 // static |
44 const char* ChromeUpdateQueryParamsDelegate::GetChannelString() { | 44 const char* ChromeUpdateQueryParamsDelegate::GetChannelString() { |
45 switch (chrome::VersionInfo::GetChannel()) { | 45 switch (chrome::VersionInfo::GetChannel()) { |
46 case chrome::VersionInfo::CHANNEL_STABLE: | 46 case version_info::Channel::STABLE: |
47 return kStable; | 47 return kStable; |
48 break; | 48 break; |
49 case chrome::VersionInfo::CHANNEL_BETA: | 49 case version_info::Channel::BETA: |
50 return kBeta; | 50 return kBeta; |
51 break; | 51 break; |
52 case chrome::VersionInfo::CHANNEL_DEV: | 52 case version_info::Channel::DEV: |
53 return kDev; | 53 return kDev; |
54 break; | 54 break; |
55 case chrome::VersionInfo::CHANNEL_CANARY: | 55 case version_info::Channel::CANARY: |
56 return kCanary; | 56 return kCanary; |
57 break; | 57 break; |
58 case chrome::VersionInfo::CHANNEL_UNKNOWN: | 58 case version_info::Channel::UNKNOWN: |
59 return kUnknown; | 59 return kUnknown; |
60 break; | 60 break; |
61 } | 61 } |
62 return kUnknown; | 62 return kUnknown; |
63 } | 63 } |
64 | 64 |
65 // static | 65 // static |
66 const char* ChromeUpdateQueryParamsDelegate::GetLang() { | 66 const char* ChromeUpdateQueryParamsDelegate::GetLang() { |
67 return g_browser_process->GetApplicationLocale().c_str(); | 67 return g_browser_process->GetApplicationLocale().c_str(); |
68 } | 68 } |
OLD | NEW |