OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/navigation/content_client/content_browser_client.h" | 5 #include "services/navigation/content_client/content_browser_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "content/public/common/mojo_application_info.h" | 11 #include "content/public/common/service_info.h" |
12 #include "content/public/common/mojo_shell_connection.h" | 12 #include "content/public/common/service_manager_connection.h" |
13 #include "content/shell/browser/shell_browser_context.h" | 13 #include "content/shell/browser/shell_browser_context.h" |
14 #include "services/navigation/content_client/browser_main_parts.h" | 14 #include "services/navigation/content_client/browser_main_parts.h" |
15 #include "services/navigation/navigation.h" | 15 #include "services/navigation/navigation.h" |
16 | 16 |
17 namespace navigation { | 17 namespace navigation { |
18 | 18 |
19 ContentBrowserClient::ContentBrowserClient() {} | 19 ContentBrowserClient::ContentBrowserClient() {} |
20 ContentBrowserClient::~ContentBrowserClient() {} | 20 ContentBrowserClient::~ContentBrowserClient() {} |
21 | 21 |
22 content::BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( | 22 content::BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( |
23 const content::MainFunctionParams& parameters) { | 23 const content::MainFunctionParams& parameters) { |
24 browser_main_parts_ = new BrowserMainParts(parameters); | 24 browser_main_parts_ = new BrowserMainParts(parameters); |
25 return browser_main_parts_; | 25 return browser_main_parts_; |
26 } | 26 } |
27 | 27 |
28 std::string ContentBrowserClient::GetShellUserIdForBrowserContext( | 28 std::string ContentBrowserClient::GetServiceUserIdForBrowserContext( |
29 content::BrowserContext* browser_context) { | 29 content::BrowserContext* browser_context) { |
30 // Unlike Chrome, where there are different browser contexts for each process, | 30 // Unlike Chrome, where there are different browser contexts for each process, |
31 // each with their own userid, here there is only one and we should reuse the | 31 // each with their own userid, here there is only one and we should reuse the |
32 // same userid as our own process to avoid having to create multiple shell | 32 // same userid as our own process to avoid having to create multiple shell |
33 // connections. | 33 // connections. |
34 return content::MojoShellConnection::GetForProcess()->GetIdentity().user_id(); | 34 return content::ServiceManagerConnection::GetForProcess()->GetIdentity() |
| 35 .user_id(); |
35 } | 36 } |
36 | 37 |
37 void ContentBrowserClient::RegisterInProcessMojoApplications( | 38 void ContentBrowserClient::RegisterInProcessServices( |
38 StaticMojoApplicationMap* apps) { | 39 StaticServiceMap* services) { |
39 content::MojoShellConnection::GetForProcess()->AddConnectionFilter( | 40 content::ServiceManagerConnection::GetForProcess()->AddConnectionFilter( |
40 base::MakeUnique<Navigation>()); | 41 base::MakeUnique<Navigation>()); |
41 } | 42 } |
42 | 43 |
43 } // namespace navigation | 44 } // namespace navigation |
OLD | NEW |