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

Unified Diff: chrome/browser/local_discovery/privetv2_setup_flow.h

Issue 299123003: PrivetV2 SetupFlow, Session and SetupOperation interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/local_discovery/privetv2_setup_flow.h
diff --git a/chrome/browser/local_discovery/privetv2_setup_flow.h b/chrome/browser/local_discovery/privetv2_setup_flow.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c2910e44af9cff2f432fcad1321ef0a4e99542e
--- /dev/null
+++ b/chrome/browser/local_discovery/privetv2_setup_flow.h
@@ -0,0 +1,67 @@
+// Copyright 2014 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_LOCAL_DISCOVERY_PRIVETV2_SETUP_FLOW_H_
+#define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV2_SETUP_FLOW_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace local_discovery {
+
+class ServiceDiscoveryClient;
+
+#if defined(ENABLE_WIFI_BOOTSTRAPPING)
+namespace wifi {
+class WifiManager;
+};
+#endif
+
+class PrivetV2SetupFlow {
+ public:
+ typedef base::Callback<void(bool confirm)> ConfirmationCallback;
Vitaly Buka (NO REVIEWS) 2014/05/23 17:22:09 callback should be part of Delegate
Noam Samuel 2014/05/23 17:30:09 Done.
+ typedef base::Callback<void(const std::string& key)> CredentialsCallback;
+
+ class Delegate {
+ public:
+ virtual ~Delegate() {}
+
+#if defined(ENABLE_WIFI_BOOTSTRAPPING)
+ virtual void OnSetupCredentialsNeeded(const std::string& ssid,
+ const CredentialsCallback& callback);
+#endif
+
+ virtual void OnSetupConfirmationNeeded(
+ const std::string& confirmation_code,
+ const ConfirmationCallback& callback) = 0;
+
+ virtual void OnSetupDone() = 0;
+
+ virtual void OnSetupError() = 0;
+ };
+
+ virtual ~PrivetV2SetupFlow() {}
+
+ static scoped_ptr<PrivetV2SetupFlow> CreateMDnsOnlyFlow(
+ ServiceDiscoveryClient* service_discovery_client,
+ const std::string& service_name);
+
+#if defined(ENABLE_WIFI_BOOTSTRAPPING)
+ static scoped_ptr<PrivetV2SetupFlow> CreateWifiFlow(
+ ServiceDiscoveryClient* service_discovery_client,
+ wifi::WifiManager* wifi_manager,
+ // The SSID of the network whose credentials we will be provisioning.
+ const std::string& credentials_ssid,
+ // The SSID of the device we will be provisioning.
+ const std::string& device_ssid);
+#endif
+
+ virtual void Start() = 0;
+};
+
+} // namespace local_discovery
+
+#endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVETV2_SETUP_FLOW_H_

Powered by Google App Engine
This is Rietveld 408576698