| 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "blimp/engine/app/blimp_browser_main_parts.h" | 6 #include "blimp/engine/app/blimp_browser_main_parts.h" |
| 7 #include "blimp/engine/app/blimp_content_browser_client.h" | 7 #include "blimp/engine/app/blimp_content_browser_client.h" |
| 8 #include "blimp/engine/app/settings_manager.h" | 8 #include "blimp/engine/app/settings_manager.h" |
| 9 #include "blimp/engine/grit/blimp_browser_resources.h" | 9 #include "blimp/engine/grit/blimp_browser_resources.h" |
| 10 #include "blimp/engine/mojo/blob_channel_service.h" | 10 #include "blimp/engine/mojo/blob_channel_service.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( | 47 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( |
| 48 service_manager::InterfaceRegistry* registry, | 48 service_manager::InterfaceRegistry* registry, |
| 49 content::RenderProcessHost* render_process_host) { | 49 content::RenderProcessHost* render_process_host) { |
| 50 registry->AddInterface<mojom::BlobChannel>(base::Bind( | 50 registry->AddInterface<mojom::BlobChannel>(base::Bind( |
| 51 &BlobChannelService::BindRequest, | 51 &BlobChannelService::BindRequest, |
| 52 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); | 52 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); |
| 53 } | 53 } |
| 54 | 54 |
| 55 std::unique_ptr<base::Value> | 55 std::unique_ptr<base::Value> |
| 56 BlimpContentBrowserClient::GetServiceManifestOverlay( | 56 BlimpContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { |
| 57 const std::string& name) { | |
| 58 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 57 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 59 int id = -1; | 58 int id = -1; |
| 60 if (name == content::mojom::kBrowserServiceName) { | 59 if (name == content::mojom::kBrowserServiceName) { |
| 61 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; | 60 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; |
| 62 } | 61 } |
| 63 if (id == -1) { | 62 if (id == -1) { |
| 64 return nullptr; | 63 return nullptr; |
| 65 } | 64 } |
| 66 | 65 |
| 67 base::StringPiece manifest_contents = | 66 base::StringPiece manifest_contents = |
| 68 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 67 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
| 69 return base::JSONReader::Read(manifest_contents); | 68 return base::JSONReader::Read(manifest_contents); |
| 70 } | 69 } |
| 71 | 70 |
| 72 } // namespace engine | 71 } // namespace engine |
| 73 } // namespace blimp | 72 } // namespace blimp |
| OLD | NEW |