| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( | 50 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( |
| 51 service_manager::InterfaceRegistry* registry, | 51 service_manager::InterfaceRegistry* registry, |
| 52 content::RenderProcessHost* render_process_host) { | 52 content::RenderProcessHost* render_process_host) { |
| 53 registry->AddInterface<mojom::BlobChannel>(base::Bind( | 53 registry->AddInterface<mojom::BlobChannel>(base::Bind( |
| 54 &BlobChannelService::BindRequest, | 54 &BlobChannelService::BindRequest, |
| 55 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); | 55 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::unique_ptr<base::Value> | 58 std::unique_ptr<base::Value> |
| 59 BlimpContentBrowserClient::GetServiceManifestOverlay( | 59 BlimpContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { |
| 60 const std::string& name) { | |
| 61 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 60 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 62 int id = -1; | 61 int id = -1; |
| 63 if (name == content::mojom::kBrowserServiceName) { | 62 if (name == content::mojom::kBrowserServiceName) { |
| 64 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; | 63 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; |
| 65 } | 64 } |
| 66 if (id == -1) { | 65 if (id == -1) { |
| 67 return nullptr; | 66 return nullptr; |
| 68 } | 67 } |
| 69 | 68 |
| 70 base::StringPiece manifest_contents = | 69 base::StringPiece manifest_contents = |
| 71 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 70 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
| 72 return base::JSONReader::Read(manifest_contents); | 71 return base::JSONReader::Read(manifest_contents); |
| 73 } | 72 } |
| 74 | 73 |
| 75 void BlimpContentBrowserClient::GetQuotaSettings( | 74 void BlimpContentBrowserClient::GetQuotaSettings( |
| 76 content::BrowserContext* context, | 75 content::BrowserContext* context, |
| 77 content::StoragePartition* partition, | 76 content::StoragePartition* partition, |
| 78 const storage::OptionalQuotaSettingsCallback& callback) { | 77 const storage::OptionalQuotaSettingsCallback& callback) { |
| 79 content::BrowserThread::PostTaskAndReplyWithResult( | 78 content::BrowserThread::PostTaskAndReplyWithResult( |
| 80 content::BrowserThread::FILE, FROM_HERE, | 79 content::BrowserThread::FILE, FROM_HERE, |
| 81 base::Bind(&storage::CalculateNominalDynamicSettings, | 80 base::Bind(&storage::CalculateNominalDynamicSettings, |
| 82 partition->GetPath(), context->IsOffTheRecord()), | 81 partition->GetPath(), context->IsOffTheRecord()), |
| 83 callback); | 82 callback); |
| 84 } | 83 } |
| 85 | 84 |
| 86 } // namespace engine | 85 } // namespace engine |
| 87 } // namespace blimp | 86 } // namespace blimp |
| OLD | NEW |