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 "blimp/engine/app/blimp_browser_main_parts.h" | 6 #include "blimp/engine/app/blimp_browser_main_parts.h" |
6 #include "blimp/engine/app/blimp_content_browser_client.h" | 7 #include "blimp/engine/app/blimp_content_browser_client.h" |
7 #include "blimp/engine/app/settings_manager.h" | 8 #include "blimp/engine/app/settings_manager.h" |
8 #include "blimp/engine/mojo/blob_channel_service.h" | 9 #include "blimp/engine/mojo/blob_channel_service.h" |
10 #include "blimp/grit/blimp_browser_resources.h" | |
9 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 #include "content/public/common/service_names.h" | |
10 #include "services/shell/public/cpp/interface_registry.h" | 13 #include "services/shell/public/cpp/interface_registry.h" |
14 #include "ui/base/resource/resource_bundle.h" | |
11 | 15 |
12 namespace blimp { | 16 namespace blimp { |
13 namespace engine { | 17 namespace engine { |
14 | 18 |
15 BlimpContentBrowserClient::BlimpContentBrowserClient() {} | 19 BlimpContentBrowserClient::BlimpContentBrowserClient() {} |
16 | 20 |
17 BlimpContentBrowserClient::~BlimpContentBrowserClient() {} | 21 BlimpContentBrowserClient::~BlimpContentBrowserClient() {} |
18 | 22 |
19 content::BrowserMainParts* BlimpContentBrowserClient::CreateBrowserMainParts( | 23 content::BrowserMainParts* BlimpContentBrowserClient::CreateBrowserMainParts( |
20 const content::MainFunctionParams& parameters) { | 24 const content::MainFunctionParams& parameters) { |
(...skipping 20 matching lines...) Expand all Loading... | |
41 } | 45 } |
42 | 46 |
43 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( | 47 void BlimpContentBrowserClient::ExposeInterfacesToRenderer( |
44 shell::InterfaceRegistry* registry, | 48 shell::InterfaceRegistry* registry, |
45 content::RenderProcessHost* render_process_host) { | 49 content::RenderProcessHost* render_process_host) { |
46 registry->AddInterface<mojom::BlobChannel>(base::Bind( | 50 registry->AddInterface<mojom::BlobChannel>(base::Bind( |
47 &BlobChannelService::BindRequest, | 51 &BlobChannelService::BindRequest, |
48 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); | 52 base::Unretained(blimp_browser_main_parts_->GetBlobChannelService()))); |
49 } | 53 } |
50 | 54 |
55 std::unique_ptr<base::Value> | |
56 BlimpContentBrowserClient::GetServiceManifestOverlay( | |
57 const std::string& name) { | |
58 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | |
59 int id = -1; | |
60 if (name == content::kBrowserMojoApplicationName) | |
nyquist
2016/09/27 20:48:48
Nit: I think most of the rest of the engine code (
Menglin
2016/09/27 22:06:40
Done.
| |
61 id = IDR_BLIMP_CONTENT_BROWSER_MANIFEST_OVERLAY; | |
62 if (id == -1) | |
63 return nullptr; | |
64 | |
65 base::StringPiece manifest_contents = | |
66 rb.GetRawDataResourceForScale(id, ui::ScaleFactor::SCALE_FACTOR_NONE); | |
67 return base::JSONReader::Read(manifest_contents); | |
68 } | |
69 | |
51 } // namespace engine | 70 } // namespace engine |
52 } // namespace blimp | 71 } // namespace blimp |
OLD | NEW |