| OLD | NEW | 
|   1 // Copyright 2015 The Chromium Authors. All rights reserved. |   1 // Copyright 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 "components/devtools_service/devtools_service_delegate.h" |   5 #include "components/devtools_service/devtools_service_delegate.h" | 
|   6  |   6  | 
|   7 #include <utility> |   7 #include <utility> | 
|   8  |   8  | 
|   9 #include "base/logging.h" |   9 #include "base/logging.h" | 
|  10 #include "components/devtools_service/devtools_registry_impl.h" |  10 #include "components/devtools_service/devtools_registry_impl.h" | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|  32 DevToolsServiceDelegate::~DevToolsServiceDelegate() { |  32 DevToolsServiceDelegate::~DevToolsServiceDelegate() { | 
|  33 } |  33 } | 
|  34  |  34  | 
|  35 void DevToolsServiceDelegate::Initialize(mojo::Shell* shell, |  35 void DevToolsServiceDelegate::Initialize(mojo::Shell* shell, | 
|  36                                          const std::string& url, |  36                                          const std::string& url, | 
|  37                                          uint32_t id) { |  37                                          uint32_t id) { | 
|  38   service_.reset(new DevToolsService(shell)); |  38   service_.reset(new DevToolsService(shell)); | 
|  39 } |  39 } | 
|  40  |  40  | 
|  41 bool DevToolsServiceDelegate::AcceptConnection(mojo::Connection* connection) { |  41 bool DevToolsServiceDelegate::AcceptConnection(mojo::Connection* connection) { | 
|  42   connection->AddService<DevToolsRegistry>(this); |  42   connection->AddInterface<DevToolsRegistry>(this); | 
|  43  |  43  | 
|  44   // DevToolsCoordinator is a privileged interface and only allowed for the |  44   // DevToolsCoordinator is a privileged interface and only allowed for the | 
|  45   // shell. |  45   // shell. | 
|  46   if (IsShell(GURL(connection->GetRemoteApplicationURL()))) |  46   if (IsShell(GURL(connection->GetRemoteApplicationURL()))) | 
|  47     connection->AddService<DevToolsCoordinator>(this); |  47     connection->AddInterface<DevToolsCoordinator>(this); | 
|  48   return true; |  48   return true; | 
|  49 } |  49 } | 
|  50  |  50  | 
|  51 void DevToolsServiceDelegate::Quit() { |  51 void DevToolsServiceDelegate::Quit() { | 
|  52   service_.reset(); |  52   service_.reset(); | 
|  53 } |  53 } | 
|  54  |  54  | 
|  55 void DevToolsServiceDelegate::Create( |  55 void DevToolsServiceDelegate::Create( | 
|  56     mojo::Connection* connection, |  56     mojo::Connection* connection, | 
|  57     mojo::InterfaceRequest<DevToolsRegistry> request) { |  57     mojo::InterfaceRequest<DevToolsRegistry> request) { | 
|  58   service_->registry()->BindToRegistryRequest(std::move(request)); |  58   service_->registry()->BindToRegistryRequest(std::move(request)); | 
|  59 } |  59 } | 
|  60  |  60  | 
|  61 void DevToolsServiceDelegate::Create( |  61 void DevToolsServiceDelegate::Create( | 
|  62     mojo::Connection* connection, |  62     mojo::Connection* connection, | 
|  63     mojo::InterfaceRequest<DevToolsCoordinator> request) { |  63     mojo::InterfaceRequest<DevToolsCoordinator> request) { | 
|  64   service_->BindToCoordinatorRequest(std::move(request)); |  64   service_->BindToCoordinatorRequest(std::move(request)); | 
|  65 } |  65 } | 
|  66  |  66  | 
|  67 }  // namespace devtools_service |  67 }  // namespace devtools_service | 
| OLD | NEW |