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 "chromecast/shell/common/cast_content_client.h" | 5 #include "chromecast/shell/common/cast_content_client.h" |
6 | 6 |
| 7 #include "chromecast/common/version.h" |
7 #include "content/public/common/user_agent.h" | 8 #include "content/public/common/user_agent.h" |
8 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
10 | 11 |
11 namespace chromecast { | 12 namespace chromecast { |
12 namespace shell { | 13 namespace shell { |
13 | 14 |
14 // TODO(lcwu): http://crbug.com/391080. Create the actual Chromecast | |
15 // product version string and hook it up here. | |
16 #define PRODUCT_VERSION "0.0.0.0" | |
17 | |
18 std::string GetUserAgent() { | 15 std::string GetUserAgent() { |
19 std::string product = "Chrome/" PRODUCT_VERSION; | 16 std::string product = "Chrome/" PRODUCT_VERSION; |
20 return content::BuildUserAgentFromProduct(product); | 17 return content::BuildUserAgentFromProduct(product) + " CrKey"; |
21 } | 18 } |
22 | 19 |
23 CastContentClient::~CastContentClient() { | 20 CastContentClient::~CastContentClient() { |
24 } | 21 } |
25 | 22 |
26 std::string CastContentClient::GetUserAgent() const { | 23 std::string CastContentClient::GetUserAgent() const { |
27 return chromecast::shell::GetUserAgent(); | 24 return chromecast::shell::GetUserAgent(); |
28 } | 25 } |
29 | 26 |
30 base::string16 CastContentClient::GetLocalizedString(int message_id) const { | 27 base::string16 CastContentClient::GetLocalizedString(int message_id) const { |
(...skipping 13 matching lines...) Expand all Loading... |
44 resource_id); | 41 resource_id); |
45 } | 42 } |
46 | 43 |
47 gfx::Image& CastContentClient::GetNativeImageNamed(int resource_id) const { | 44 gfx::Image& CastContentClient::GetNativeImageNamed(int resource_id) const { |
48 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 45 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
49 resource_id); | 46 resource_id); |
50 } | 47 } |
51 | 48 |
52 } // namespace shell | 49 } // namespace shell |
53 } // namespace chromecast | 50 } // namespace chromecast |
OLD | NEW |