Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1820)

Unified Diff: chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h

Issue 2726223004: Introduce networking.cast API (Closed)
Patch Set: histograms Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h
diff --git a/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..618e4ca0959e475172045adb18cfbc71ac63d248
--- /dev/null
+++ b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h
@@ -0,0 +1,66 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_CHROME_NETWORKING_CAST_PRIVATE_DELEGATE_H_
+#define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_CHROME_NETWORKING_CAST_PRIVATE_DELEGATE_H_
+
+#include <memory>
+#include <string>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "extensions/browser/api/networking_private/networking_cast_private_delegate.h"
+#include "extensions/browser/api/networking_private/networking_private_delegate.h"
+
+namespace extensions {
+
+// Chrome implementation of extensions::NetworkingCastPrivateDelegate.
+class ChromeNetworkingCastPrivateDelegate
+ : public NetworkingCastPrivateDelegate {
+ public:
+ using FactoryCallback =
+ base::Callback<std::unique_ptr<ChromeNetworkingCastPrivateDelegate>()>;
+ static void SetFactoryCallbackForTest(FactoryCallback* factory_callback);
+
+ static std::unique_ptr<ChromeNetworkingCastPrivateDelegate> Create();
+
+ ~ChromeNetworkingCastPrivateDelegate() override;
+
+ // NetworkingCastPrivateDelegate overrides:
+ void VerifyDestination(
+ const api::networking_private::VerificationProperties& properties,
+ const VerifiedCallback& success_callback,
+ const FailureCallback& failure_callback) override;
+ void VerifyAndEncryptCredentials(
+ const std::string& guid,
+ const api::networking_private::VerificationProperties& properties,
+ const DataCallback& success_callback,
+ const FailureCallback& failure_callback) override;
+ void VerifyAndEncryptData(
+ const std::string& data,
+ const api::networking_private::VerificationProperties& properties,
+ const DataCallback& success_callback,
+ const FailureCallback& failure_callback) override;
+
+ private:
+ // Friend the test so it can inject stub VerifyDelegate implementation.
+ // TODO(tbarzic): Remove this when NetworkingCastPrivateDelegate stops
+ // depending on
+ // NetworkingPrivateDelegate::VerifyDelegate.
+ friend class NetworkingCastPrivateApiTest;
+
+ explicit ChromeNetworkingCastPrivateDelegate(
+ std::unique_ptr<NetworkingPrivateDelegate::VerifyDelegate>
+ verify_delegate);
+
+ // NetworkingPrivates API's crypto utility to which verification requests
+ // will be routed.
+ std::unique_ptr<NetworkingPrivateDelegate::VerifyDelegate> crypto_verify_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeNetworkingCastPrivateDelegate);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_CAST_PRIVATE_CHROME_NETWORKING_CAST_PRIVATE_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698