| 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/browser/cast_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 info.factory = base::Bind(&CreateMediaService, base::Unretained(this)); | 467 info.factory = base::Bind(&CreateMediaService, base::Unretained(this)); |
| 468 info.task_runner = GetMediaTaskRunner(); | 468 info.task_runner = GetMediaTaskRunner(); |
| 469 services->insert(std::make_pair("media", info)); | 469 services->insert(std::make_pair("media", info)); |
| 470 #endif | 470 #endif |
| 471 } | 471 } |
| 472 | 472 |
| 473 std::unique_ptr<base::Value> | 473 std::unique_ptr<base::Value> |
| 474 CastContentBrowserClient::GetServiceManifestOverlay( | 474 CastContentBrowserClient::GetServiceManifestOverlay( |
| 475 base::StringPiece service_name) { | 475 base::StringPiece service_name) { |
| 476 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 476 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 477 if (service_name != content::mojom::kBrowserServiceName) | 477 int id = -1; |
| 478 if (service_name == content::mojom::kBrowserServiceName) |
| 479 id = IDR_CAST_CONTENT_BROWSER_MANIFEST_OVERLAY; |
| 480 else if (service_name == content::mojom::kPackagedServicesServiceName) |
| 481 id = IDR_CAST_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY; |
| 482 else |
| 478 return nullptr; | 483 return nullptr; |
| 479 base::StringPiece manifest_contents = | 484 base::StringPiece manifest_contents = |
| 480 rb.GetRawDataResourceForScale(IDR_CAST_CONTENT_BROWSER_MANIFEST_OVERLAY, | 485 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
| 481 ui::ScaleFactor::SCALE_FACTOR_NONE); | |
| 482 return base::JSONReader::Read(manifest_contents); | 486 return base::JSONReader::Read(manifest_contents); |
| 483 } | 487 } |
| 484 | 488 |
| 485 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 489 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 486 const base::CommandLine& command_line, | 490 const base::CommandLine& command_line, |
| 487 int child_process_id, | 491 int child_process_id, |
| 488 content::FileDescriptorInfo* mappings) { | 492 content::FileDescriptorInfo* mappings) { |
| 489 #if defined(OS_ANDROID) | 493 #if defined(OS_ANDROID) |
| 490 mappings->ShareWithRegion( | 494 mappings->ShareWithRegion( |
| 491 kAndroidPakDescriptor, | 495 kAndroidPakDescriptor, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 process_type, dumps_path, false /* upload */); | 550 process_type, dumps_path, false /* upload */); |
| 547 // StartUploaderThread() even though upload is diferred. | 551 // StartUploaderThread() even though upload is diferred. |
| 548 // Breakpad-related memory is freed in the uploader thread. | 552 // Breakpad-related memory is freed in the uploader thread. |
| 549 crash_handler->StartUploaderThread(); | 553 crash_handler->StartUploaderThread(); |
| 550 return crash_handler; | 554 return crash_handler; |
| 551 } | 555 } |
| 552 #endif // !defined(OS_ANDROID) | 556 #endif // !defined(OS_ANDROID) |
| 553 | 557 |
| 554 } // namespace shell | 558 } // namespace shell |
| 555 } // namespace chromecast | 559 } // namespace chromecast |
| OLD | NEW |