OLD | NEW |
| (Empty) |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/common/chrome_content_client.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "base/strings/string_piece.h" | |
9 #include "chrome/common/url_constants.h" | |
10 #include "components/version_info/version_info.h" | |
11 #include "content/public/common/user_agent.h" | |
12 #include "ui/base/l10n/l10n_util.h" | |
13 #include "ui/base/resource/resource_bundle.h" | |
14 #include "url/gurl.h" | |
15 #include "url/url_util.h" | |
16 | |
17 // TODO(ios): Investigate merging with chrome_content_client.cc; this would | |
18 // requiring either a lot of ifdefing, or spliting the file into parts. | |
19 | |
20 void ChromeContentClient::SetActiveURL(const GURL& url) { | |
21 NOTIMPLEMENTED(); | |
22 } | |
23 | |
24 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { | |
25 NOTIMPLEMENTED(); | |
26 } | |
27 | |
28 void ChromeContentClient::AddPepperPlugins( | |
29 std::vector<content::PepperPluginInfo>* plugins) { | |
30 NOTREACHED(); | |
31 } | |
32 | |
33 void ChromeContentClient::AddAdditionalSchemes( | |
34 std::vector<url::SchemeWithType>* standard_schemes, | |
35 std::vector<url::SchemeWithType>* referrer_schemes, | |
36 std::vector<std::string>* saveable_shemes) { | |
37 // No additional schemes for iOS. | |
38 } | |
39 | |
40 std::string ChromeContentClient::GetProduct() const { | |
41 std::string product("CriOS/"); | |
42 product += version_info::GetVersionNumber(); | |
43 return product; | |
44 } | |
45 | |
46 std::string ChromeContentClient::GetUserAgent() const { | |
47 std::string product = GetProduct(); | |
48 return content::BuildUserAgentFromProduct(product); | |
49 } | |
50 | |
51 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { | |
52 return l10n_util::GetStringUTF16(message_id); | |
53 } | |
54 | |
55 base::StringPiece ChromeContentClient::GetDataResource( | |
56 int resource_id, | |
57 ui::ScaleFactor scale_factor) const { | |
58 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | |
59 resource_id, scale_factor); | |
60 } | |
61 | |
62 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( | |
63 int resource_id) const { | |
64 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | |
65 } | |
66 | |
67 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { | |
68 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | |
69 } | |
70 | |
71 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) { | |
72 DCHECK(false) << "Unknown child process type!"; | |
73 return "Unknown"; | |
74 } | |
OLD | NEW |