 Chromium Code Reviews
 Chromium Code Reviews Issue 2503063003:
  Add service name constant for UI service.  (Closed)
    
  
    Issue 2503063003:
  Add service name constant for UI service.  (Closed) 
  | 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 "mash/init/init.h" | 5 #include "mash/init/init.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" | 
| 9 #include "base/guid.h" | 9 #include "base/guid.h" | 
| 10 #include "mash/login/public/interfaces/login.mojom.h" | 10 #include "mash/login/public/interfaces/login.mojom.h" | 
| 11 #include "services/service_manager/public/cpp/connection.h" | 11 #include "services/service_manager/public/cpp/connection.h" | 
| 12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" | 
| 13 #include "services/service_manager/public/cpp/interface_registry.h" | 13 #include "services/service_manager/public/cpp/interface_registry.h" | 
| 14 #include "services/service_manager/public/cpp/service_context.h" | 14 #include "services/service_manager/public/cpp/service_context.h" | 
| 15 #include "services/ui/public/interfaces/constants.mojom.h" | |
| 15 | 16 | 
| 16 namespace mash { | 17 namespace mash { | 
| 17 namespace init { | 18 namespace init { | 
| 18 | 19 | 
| 19 Init::Init() {} | 20 Init::Init() {} | 
| 20 Init::~Init() {} | 21 Init::~Init() {} | 
| 21 | 22 | 
| 22 void Init::OnStart() { | 23 void Init::OnStart() { | 
| 23 context()->connector()->Connect("ui"); | 24 context()->connector()->Connect(ui::mojom::kServiceName); | 
| 
James Cook
2016/11/16 00:46:02
I like this. It's clear to me that it's connecting
 | |
| 24 StartTracing(); | 25 StartTracing(); | 
| 25 StartLogin(); | 26 StartLogin(); | 
| 26 } | 27 } | 
| 27 | 28 | 
| 28 bool Init::OnConnect(const service_manager::ServiceInfo& remote_info, | 29 bool Init::OnConnect(const service_manager::ServiceInfo& remote_info, | 
| 29 service_manager::InterfaceRegistry* registry) { | 30 service_manager::InterfaceRegistry* registry) { | 
| 30 registry->AddInterface<mojom::Init>(this); | 31 registry->AddInterface<mojom::Init>(this); | 
| 31 return true; | 32 return true; | 
| 32 } | 33 } | 
| 33 | 34 | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 67 | 
| 67 void Init::StartLogin() { | 68 void Init::StartLogin() { | 
| 68 login_connection_ = context()->connector()->Connect("login"); | 69 login_connection_ = context()->connector()->Connect("login"); | 
| 69 mash::login::mojom::LoginPtr login; | 70 mash::login::mojom::LoginPtr login; | 
| 70 login_connection_->GetInterface(&login); | 71 login_connection_->GetInterface(&login); | 
| 71 login->ShowLoginUI(); | 72 login->ShowLoginUI(); | 
| 72 } | 73 } | 
| 73 | 74 | 
| 74 } // namespace init | 75 } // namespace init | 
| 75 } // namespace main | 76 } // namespace main | 
| OLD | NEW |