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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 blimp_browser_main_parts_->GetSettingsManager()->UpdateWebkitPreferences( | 39 blimp_browser_main_parts_->GetSettingsManager()->UpdateWebkitPreferences( |
40 prefs); | 40 prefs); |
41 } | 41 } |
42 | 42 |
43 BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() { | 43 BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() { |
44 return blimp_browser_main_parts_->GetBrowserContext(); | 44 return blimp_browser_main_parts_->GetBrowserContext(); |
45 } | 45 } |
46 | 46 |
47 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( | 47 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( |
48 shell::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( |
57 const std::string& name) { | 57 const std::string& name) { |
58 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 58 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
59 int id = -1; | 59 int id = -1; |
60 if (name == content::kBrowserServiceName) { | 60 if (name == content::kBrowserServiceName) { |
61 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; | 61 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; |
62 } | 62 } |
63 if (id == -1) { | 63 if (id == -1) { |
64 return nullptr; | 64 return nullptr; |
65 } | 65 } |
66 | 66 |
67 base::StringPiece manifest_contents = | 67 base::StringPiece manifest_contents = |
68 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 68 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
69 return base::JSONReader::Read(manifest_contents); | 69 return base::JSONReader::Read(manifest_contents); |
70 } | 70 } |
71 | 71 |
72 } // namespace engine | 72 } // namespace engine |
73 } // namespace blimp | 73 } // namespace blimp |
OLD | NEW |