| 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 #ifndef EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_
SERVICE_IMPL_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_
SERVICE_IMPL_H_ |
| 6 #define EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_
SERVICE_IMPL_H_ | 6 #define EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSION_
SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 8 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 9 #include "extensions/browser/api/display_source/display_source_connection_delega
te.h" | 9 #include "extensions/browser/api/display_source/display_source_connection_delega
te.h" |
| 10 #include "extensions/common/mojo/wifi_display_session_service.mojom.h" | 10 #include "extensions/common/mojo/wifi_display_session_service.mojom.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class BrowserContext; | 16 class BrowserContext; |
| 16 } // namespace content | 17 } // namespace content |
| 17 | 18 |
| 18 namespace extensions { | 19 namespace extensions { |
| 19 | 20 |
| 20 // This class provides access to the network transport for the Wi-Fi Display | 21 // This class provides access to the network transport for the Wi-Fi Display |
| 21 // session (which is itself hosted in the sandboxed renderer process). | 22 // session (which is itself hosted in the sandboxed renderer process). |
| 22 class WiFiDisplaySessionServiceImpl | 23 class WiFiDisplaySessionServiceImpl |
| 23 : public mojom::WiFiDisplaySessionService, | 24 : public mojom::WiFiDisplaySessionService, |
| 24 public DisplaySourceConnectionDelegate::Observer { | 25 public DisplaySourceConnectionDelegate::Observer { |
| 25 public: | 26 public: |
| 26 ~WiFiDisplaySessionServiceImpl() override; | 27 ~WiFiDisplaySessionServiceImpl() override; |
| 27 static void BindToRequest( | 28 static void BindToRequest(content::BrowserContext* context, |
| 28 content::BrowserContext* context, | 29 const service_manager::BindSourceInfo& source_info, |
| 29 mojo::InterfaceRequest<mojom::WiFiDisplaySessionService> request); | 30 mojom::WiFiDisplaySessionServiceRequest request); |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 // WiFiDisplaySessionService overrides. | 33 // WiFiDisplaySessionService overrides. |
| 33 void SetClient(mojom::WiFiDisplaySessionServiceClientPtr client) override; | 34 void SetClient(mojom::WiFiDisplaySessionServiceClientPtr client) override; |
| 34 void Connect(int32_t sink_id, | 35 void Connect(int32_t sink_id, |
| 35 int32_t auth_method, | 36 int32_t auth_method, |
| 36 const std::string& auth_data) override; | 37 const std::string& auth_data) override; |
| 37 void Disconnect() override; | 38 void Disconnect() override; |
| 38 void SendMessage(const std::string& message) override; | 39 void SendMessage(const std::string& message) override; |
| 39 | 40 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 mojo::StrongBindingPtr<mojom::WiFiDisplaySessionService> binding_; | 67 mojo::StrongBindingPtr<mojom::WiFiDisplaySessionService> binding_; |
| 67 base::WeakPtrFactory<WiFiDisplaySessionServiceImpl> weak_factory_; | 68 base::WeakPtrFactory<WiFiDisplaySessionServiceImpl> weak_factory_; |
| 68 | 69 |
| 69 DISALLOW_COPY_AND_ASSIGN(WiFiDisplaySessionServiceImpl); | 70 DISALLOW_COPY_AND_ASSIGN(WiFiDisplaySessionServiceImpl); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace extensions | 73 } // namespace extensions |
| 73 | 74 |
| 74 #endif // EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSI
ON_SERVICE_IMPL_H_ | 75 #endif // EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_SESSI
ON_SERVICE_IMPL_H_ |
| OLD | NEW |