| 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 "blimp/engine/app/blimp_content_browser_client.h" | 5 #include "blimp/engine/app/blimp_content_browser_client.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/settings_manager.h" | 7 #include "blimp/engine/app/settings_manager.h" |
| 8 #include "blimp/engine/mojo/blob_channel_service.h" | 8 #include "blimp/engine/mojo/blob_channel_service.h" |
| 9 #include "blimp/net/blob_channel/blob_channel_sender.h" |
| 10 #include "content/public/browser/browser_thread.h" |
| 11 #include "services/shell/public/cpp/connection.h" |
| 9 #include "services/shell/public/cpp/interface_registry.h" | 12 #include "services/shell/public/cpp/interface_registry.h" |
| 10 | 13 |
| 11 namespace blimp { | 14 namespace blimp { |
| 12 namespace engine { | 15 namespace engine { |
| 13 | 16 |
| 14 BlimpContentBrowserClient::BlimpContentBrowserClient() {} | 17 BlimpContentBrowserClient::BlimpContentBrowserClient() {} |
| 15 | 18 |
| 16 BlimpContentBrowserClient::~BlimpContentBrowserClient() {} | 19 BlimpContentBrowserClient::~BlimpContentBrowserClient() {} |
| 17 | 20 |
| 18 content::BrowserMainParts* BlimpContentBrowserClient::CreateBrowserMainParts( | 21 content::BrowserMainParts* BlimpContentBrowserClient::CreateBrowserMainParts( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 33 | 36 |
| 34 blimp_browser_main_parts_->GetSettingsManager()->UpdateWebkitPreferences( | 37 blimp_browser_main_parts_->GetSettingsManager()->UpdateWebkitPreferences( |
| 35 prefs); | 38 prefs); |
| 36 } | 39 } |
| 37 | 40 |
| 38 BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() { | 41 BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() { |
| 39 return blimp_browser_main_parts_->GetBrowserContext(); | 42 return blimp_browser_main_parts_->GetBrowserContext(); |
| 40 } | 43 } |
| 41 | 44 |
| 42 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( | 45 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( |
| 43 shell::InterfaceRegistry* registry, | 46 shell::Connection* connection) { |
| 44 content::RenderProcessHost* render_process_host) { | 47 connection->GetInterfaceRegistry()->AddInterface(base::Bind( |
| 45 registry->AddInterface<mojom::BlobChannel>( | 48 &BlimpContentBrowserClient::BindBlobChannel, base::Unretained(this)), |
| 46 base::Bind(&BlobChannelService::Create, | 49 content::BrowserThread::GetTaskRunnerForThread( |
| 47 blimp_browser_main_parts_->GetBlobChannelSender())); | 50 content::BrowserThread::UI)); |
| 51 } |
| 52 |
| 53 void BlimpContentBrowserClient::BindBlobChannel( |
| 54 mojom::BlobChannelRequest request) { |
| 55 BlobChannelService::Create(blimp_browser_main_parts_->GetBlobChannelSender(), |
| 56 std::move(request)); |
| 48 } | 57 } |
| 49 | 58 |
| 50 } // namespace engine | 59 } // namespace engine |
| 51 } // namespace blimp | 60 } // namespace blimp |
| OLD | NEW |