Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
3141 std::unique_ptr<base::Value>
3142 ChromeContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) {
3143 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
3144 if (name != NULL) {
3145 __android_log_print(ANDROID_LOG_ERROR, "GetServiceManifestOverlay",
3146 "Name: %s", name.data());
3147 } else {
3148 __android_log_print(ANDROID_LOG_ERROR, "GetServiceManifestOverlay",
3149 "Called with null name!");
3150 }
3151
3152 int id = -1;
3153 if (name == content::mojom::kBrowserServiceName)
3154 id = IDR_CHROME_CONTENT_BROWSER_MANIFEST_OVERLAY;
3155 else if (name == content::mojom::kGpuServiceName)
3156 id = IDR_CHROME_CONTENT_GPU_MANIFEST_OVERLAY;
3157 else if (name == content::mojom::kPackagedServicesServiceName)
3158 id = IDR_CHROME_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY;
3159 else if (name == content::mojom::kPluginServiceName)
3160 id = IDR_CHROME_CONTENT_PLUGIN_MANIFEST_OVERLAY;
3161 else if (name == content::mojom::kRendererServiceName)
3162 id = IDR_CHROME_CONTENT_RENDERER_MANIFEST_OVERLAY;
3163 else if (name == content::mojom::kUtilityServiceName)
3164 id = IDR_CHROME_CONTENT_UTILITY_MANIFEST_OVERLAY;
3165
3166 if (id == -1) {
3167 if (name != NULL) {
3168 __android_log_print(ANDROID_LOG_ERROR, "GetServiceManifestOverlay",
3169 "Failed to get overlay for %s", name.data());
3170 }
3171 return nullptr;
3172 }
3173
3174 base::StringPiece manifest_contents =
3175 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE);
3176
3177 if (manifest_contents == NULL) {
3178 __android_log_print(ANDROID_LOG_ERROR, "GetServiceManifestOverlay",
3179 "Failed to get overlay for %s, returning nullptr", name.data());
3180 return nullptr;
3181 }
3182
3183 return base::JSONReader::Read(manifest_contents);
3184 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.