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

Unified Diff: chrome/utility/networking_private_handler.h

Issue 22295002: Base infrastructure for Networking Private API on Windows and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync up to r225168 Created 7 years, 3 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/utility/networking_private_handler.h
diff --git a/chrome/utility/networking_private_handler.h b/chrome/utility/networking_private_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..6a11041178d92cf7d830fda3dbf372a450a028d3
--- /dev/null
+++ b/chrome/utility/networking_private_handler.h
@@ -0,0 +1,112 @@
+// Copyright (c) 2013 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_UTILITY_NETWORKING_PRIVATE_HANDLER_H_
+#define CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "chrome/utility/utility_message_handler.h"
+#include "chrome/utility/wifi/wifi_service.h"
+
+namespace base {
+class DictionaryValue;
+class Thread;
+}
+
+namespace chrome {
+
+// Dispatches IPCs for out of process networkingPrivate API calls.
+class NetworkingPrivateHandler : public UtilityMessageHandler {
+ public:
+ NetworkingPrivateHandler();
+ virtual ~NetworkingPrivateHandler();
+
+ // IPC::Listener:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Send IPC message from UtilityThread.
+ static bool Send(IPC::Message* message);
+
+ private:
+ // IPC Message Handlers.
+
+ // Use WiFiServiceMock with |parameters| for unit testing.
+ void OnUseWiFiServiceMock(const base::DictionaryValue& parameters);
stevenjb 2013/09/25 19:09:15 Append ForTest to the end of this if only used for
mef 2013/10/08 21:46:26 Done.
+
+ // Common callback from WiFiService when error with |error_name| occurs.
+ // Sends |NetworkingPrivateMsg_API_Error| back to browser process.
+ // |message_id| is used to by NetworkingPrivateProcessClient to find matching
+ // request.
+ void OnApiError(int message_id,
+ const std::string& error_name,
+ scoped_ptr<base::DictionaryValue> error_data);
+
+ // Get properties of network identified by |network_guid|.
+ void OnGetPropertiesStart(int message_id, const std::string& network_guid);
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Callback from |WiFiService| to send |properties| back to browser process.
+ void OnGetPropertiesSucceeded(
+ int message_id,
+ const std::string& network_guid,
+ const WiFiService::NetworkProperties& properties);
+
+ // Set properties of network identified by |network_guid|.
+ void OnSetPropertiesStart(int message_id,
+ const std::string& network_guid,
+ const base::DictionaryValue& properties);
+
+ // Callback from |WiFiService| to report set properties success back to
+ // browser process.
+ void OnSetPropertiesSucceeded(int message_id,
+ const std::string& network_guid);
+
+ // Start connect to network identified by |network_guid|. Does not wait for
+ // connect to succeed. If another network is connected, it will be remembered
+ // and disconnected prior to connect.
+ void OnStartConnectStart(int message_id, const std::string& network_guid);
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Callback from |WiFiService| to report start connect success back to
+ // browser process. Does not wait for connect to actually succeed. If/When
+ // connect succeeds the |NetworksChanged| event will be generated.
+ void OnStartConnectSucceeded(int message_id, const std::string& network_guid);
+
+ // Start disconnect from network identified by |network_guid|. Does not wait
+ // for disconnect to succeed.
+ void OnStartDisconnectStart(int message_id, const std::string& network_guid);
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Callback from |WiFiService| to report start disconnect success back to
+ // browser process. Does not wait for disconnect to actually succeed. If/When
+ // disconnect succeeds the |NetworksChanged| event will be generated.
+ void OnStartDisconnectSucceeded(int message_id,
+ const std::string& network_guid);
+
+ // Request network scan. Does not wait for scan to complete.
+ void OnRequestNetworkScan();
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Callback from |WiFiService| to report that network scan has succeded.
+ // Generates |NetworkListChanged| event based on current |network_list|.
+ void OnNetworkScanSucceeded(const WiFiService::NetworkList& network_list);
+
+ // Get current list of visible networks.
+ void OnGetVisibleNetworks(int message_id);
stevenjb 2013/09/25 19:09:15 WS
mef 2013/10/08 21:46:26 Done.
+ // Callback from |WiFiService| to report list of visible networks.
+ void OnGetVisibleNetworksSucceeded(
+ int message_id,
+ const WiFiService::NetworkList& network_list);
+
+ // Send |NetworkListChanged| event with |network_guid_list|.
+ void OnNetworkListChangedEvent(
+ const WiFiService::NetworkGuidList& network_guid_list);
+
+ // Send |NetworksChanged| event with |network_guid_list|.
+ void OnNetworksChangedEvent(
+ const WiFiService::NetworkGuidList& network_guid_list);
+
+ // Platform-specific WiFi service.
+ scoped_ptr<WiFiService> wifi_service_;
stevenjb 2013/09/25 19:09:15 DISALLOW_COPY_AND_ASSIGN
mef 2013/10/08 21:46:26 Done.
+};
+
+} // namespace chrome
+
+#endif // CHROME_UTILITY_NETWORKING_PRIVATE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698