Chromium Code Reviews| 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" | |
| 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 blimp { | 12 namespace blimp { |
| 12 namespace engine { | 13 namespace engine { |
| 13 | 14 |
| 14 // TODO(haibinlu) Generate proper version. See crbug/537367. | |
| 15 const char kProduct[] = "Chrome/20.77.33.5"; | |
| 16 | |
| 17 std::string GetBlimpEngineUserAgent() { | 15 std::string GetBlimpEngineUserAgent() { |
|
Wez
2015/12/17 02:01:31
Do we need this as a static? Can't we just fold it
haibinlu
2015/12/17 02:28:55
it is also in blimp_url_request_context_getter.cc
| |
| 18 return content::BuildUserAgentFromProduct(kProduct); | 16 return content::BuildUserAgentFromProduct( |
| 17 version_info::GetProductNameAndVersionForUserAgent() + " Mobile"); | |
| 19 } | 18 } |
| 20 | 19 |
| 21 BlimpContentClient::~BlimpContentClient() {} | 20 BlimpContentClient::~BlimpContentClient() {} |
| 22 | 21 |
| 23 std::string BlimpContentClient::GetUserAgent() const { | 22 std::string BlimpContentClient::GetUserAgent() const { |
| 24 return GetBlimpEngineUserAgent(); | 23 return GetBlimpEngineUserAgent(); |
| 25 } | 24 } |
| 26 | 25 |
| 27 base::string16 BlimpContentClient::GetLocalizedString(int message_id) const { | 26 base::string16 BlimpContentClient::GetLocalizedString(int message_id) const { |
| 28 return l10n_util::GetStringUTF16(message_id); | 27 return l10n_util::GetStringUTF16(message_id); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 41 resource_id); | 40 resource_id); |
| 42 } | 41 } |
| 43 | 42 |
| 44 gfx::Image& BlimpContentClient::GetNativeImageNamed(int resource_id) const { | 43 gfx::Image& BlimpContentClient::GetNativeImageNamed(int resource_id) const { |
| 45 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 44 return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 46 resource_id); | 45 resource_id); |
| 47 } | 46 } |
| 48 | 47 |
| 49 } // namespace engine | 48 } // namespace engine |
| 50 } // namespace blimp | 49 } // namespace blimp |
| OLD | NEW |