| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/messaging/native_message_host.h" | 5 #include "extensions/browser/api/messaging/native_message_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 std::unique_ptr<NativeMessageHost> (*create_function)(); | 93 std::unique_ptr<NativeMessageHost> (*create_function)(); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 std::unique_ptr<NativeMessageHost> CreateIt2MeHost() { | 96 std::unique_ptr<NativeMessageHost> CreateIt2MeHost() { |
| 97 std::unique_ptr<remoting::It2MeHostFactory> host_factory( | 97 std::unique_ptr<remoting::It2MeHostFactory> host_factory( |
| 98 new remoting::It2MeHostFactory()); | 98 new remoting::It2MeHostFactory()); |
| 99 host_factory->set_policy_service(g_browser_process->policy_service()); | 99 host_factory->set_policy_service(g_browser_process->policy_service()); |
| 100 std::unique_ptr<remoting::ChromotingHostContext> context = | 100 std::unique_ptr<remoting::ChromotingHostContext> context = |
| 101 remoting::ChromotingHostContext::CreateForChromeOS( | 101 remoting::ChromotingHostContext::CreateForChromeOS( |
| 102 make_scoped_refptr(g_browser_process->system_request_context()), | 102 make_scoped_refptr(g_browser_process->system_request_context()), |
| 103 content::BrowserThread::GetMessageLoopProxyForThread( | 103 content::BrowserThread::GetTaskRunnerForThread( |
| 104 content::BrowserThread::IO), | 104 content::BrowserThread::IO), |
| 105 content::BrowserThread::GetMessageLoopProxyForThread( | 105 content::BrowserThread::GetTaskRunnerForThread( |
| 106 content::BrowserThread::UI), | 106 content::BrowserThread::UI), |
| 107 content::BrowserThread::GetMessageLoopProxyForThread( | 107 content::BrowserThread::GetTaskRunnerForThread( |
| 108 content::BrowserThread::FILE)); | 108 content::BrowserThread::FILE)); |
| 109 std::unique_ptr<NativeMessageHost> host( | 109 std::unique_ptr<NativeMessageHost> host( |
| 110 new remoting::It2MeNativeMessagingHost(std::move(context), | 110 new remoting::It2MeNativeMessagingHost(std::move(context), |
| 111 std::move(host_factory))); | 111 std::move(host_factory))); |
| 112 return host; | 112 return host; |
| 113 } | 113 } |
| 114 | 114 |
| 115 // If you modify the list of allowed_origins, don't forget to update | 115 // If you modify the list of allowed_origins, don't forget to update |
| 116 // remoting/host/it2me/com.google.chrome.remote_assistance.json.jinja2 | 116 // remoting/host/it2me/com.google.chrome.remote_assistance.json.jinja2 |
| 117 // to keep the two lists in sync. | 117 // to keep the two lists in sync. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 *error = kForbiddenError; | 174 *error = kForbiddenError; |
| 175 return nullptr; | 175 return nullptr; |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 *error = kNotFoundError; | 178 *error = kNotFoundError; |
| 179 return nullptr; | 179 return nullptr; |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace extensions | 182 } // namespace extensions |
| OLD | NEW |