OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "blimp/engine/common/blimp_content_client.h" | 5 #include "blimp/engine/common/blimp_content_client.h" |
6 | 6 |
7 #include "components/version_info/version_info.h" | |
8 #include "content/public/common/user_agent.h" | |
9 #include "ui/base/l10n/l10n_util.h" | 7 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
11 | 9 |
12 namespace blimp { | 10 namespace blimp { |
13 namespace engine { | 11 namespace engine { |
14 | 12 |
15 std::string client_os_info = "Linux; Android 5.1.1"; | |
16 | |
17 std::string GetBlimpEngineUserAgent() { | |
18 return content::BuildUserAgentFromOSAndProduct( | |
19 client_os_info, | |
20 version_info::GetProductNameAndVersionForUserAgent() + " Mobile"); | |
21 } | |
22 | |
23 void SetClientOSInfo(std::string os_version_info) { | |
24 client_os_info = os_version_info; | |
25 } | |
26 | |
27 BlimpContentClient::~BlimpContentClient() {} | 13 BlimpContentClient::~BlimpContentClient() {} |
28 | 14 |
29 std::string BlimpContentClient::GetUserAgent() const { | 15 std::string BlimpContentClient::GetUserAgent() const { |
30 return GetBlimpEngineUserAgent(); | 16 return GetBlimpEngineUserAgent(); |
31 } | 17 } |
32 | 18 |
33 base::string16 BlimpContentClient::GetLocalizedString(int message_id) const { | 19 base::string16 BlimpContentClient::GetLocalizedString(int message_id) const { |
34 return l10n_util::GetStringUTF16(message_id); | 20 return l10n_util::GetStringUTF16(message_id); |
35 } | 21 } |
36 | 22 |
(...skipping 10 matching lines...) Expand all Loading... |
47 resource_id); | 33 resource_id); |
48 } | 34 } |
49 | 35 |
50 gfx::Image& BlimpContentClient::GetNativeImageNamed(int resource_id) const { | 36 gfx::Image& BlimpContentClient::GetNativeImageNamed(int resource_id) const { |
51 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 37 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
52 resource_id); | 38 resource_id); |
53 } | 39 } |
54 | 40 |
55 } // namespace engine | 41 } // namespace engine |
56 } // namespace blimp | 42 } // namespace blimp |
OLD | NEW |