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

Unified Diff: chrome/browser/chromeos/options/wifi_config_view.h

Issue 21046008: Convert all connect code to use NetworkHandler instead of NetworkLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Round 2.1 Created 7 years, 4 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/chromeos/options/wifi_config_view.h
diff --git a/chrome/browser/chromeos/options/wifi_config_view.h b/chrome/browser/chromeos/options/wifi_config_view.h
index 574072da015cc413ddd7e8a01022db6e11b0d9ec..573cad63bed561ccb454030f43b68159413a8f72 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.h
+++ b/chrome/browser/chromeos/options/wifi_config_view.h
@@ -10,10 +10,12 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "chrome/browser/chromeos/cros/cert_library.h"
#include "chrome/browser/chromeos/cros/network_property_ui_data.h"
#include "chrome/browser/chromeos/options/network_config_view.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/models/combobox_model.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/combobox/combobox_listener.h"
@@ -28,6 +30,8 @@ class ToggleImageButton;
namespace chromeos {
+class NetworkState;
+
namespace internal {
class EAPMethodComboboxModel;
class Phase2AuthComboboxModel;
@@ -43,11 +47,9 @@ class WifiConfigView : public ChildNetworkConfigView,
public views::ComboboxListener,
public CertLibrary::Observer {
public:
- // Wifi login dialog for wifi network |wifi|. |wifi| must be a non NULL
- // pointer to a WifiNetwork in NetworkLibrary.
- WifiConfigView(NetworkConfigView* parent, WifiNetwork* wifi);
- // Wifi login dialog for "Joining other network..."
- WifiConfigView(NetworkConfigView* parent, bool show_8021x);
+ WifiConfigView(NetworkConfigView* parent,
+ const std::string& service_path,
+ bool show_8021x);
virtual ~WifiConfigView();
// views::TextfieldController:
@@ -77,18 +79,23 @@ class WifiConfigView : public ChildNetworkConfigView,
// Parses a WiFi UI |property| from the ONC associated with |network|. |key|
// is the property name within the ONC WiFi dictionary.
static void ParseWiFiUIProperty(NetworkPropertyUIData* property_ui_data,
- Network* network,
+ const NetworkState* network,
const std::string& key);
// Parses a WiFi EAP UI |property| from the ONC associated with |network|.
// |key| is the property name within the ONC WiFi.EAP dictionary.
static void ParseWiFiEAPUIProperty(NetworkPropertyUIData* property_ui_data,
- Network* network,
+ const NetworkState* network,
const std::string& key);
private:
// Initializes UI. If |show_8021x| includes 802.1x config options.
- void Init(WifiNetwork* wifi, bool show_8021x);
+ void Init(bool show_8021x);
+
+ // Callback to initialize fields from uncached network properties.
+ void InitFromProperties(bool show_8021x,
+ const std::string& service_path,
+ const base::DictionaryValue& dictionary);
// Get input values.
std::string GetSsid() const;
@@ -97,14 +104,17 @@ class WifiConfigView : public ChildNetworkConfigView,
bool GetShareNetwork(bool share_default) const;
// Get various 802.1X EAP values from the widgets.
- EAPMethod GetEapMethod() const;
- EAPPhase2Auth GetEapPhase2Auth() const;
+ std::string GetEapMethod() const;
+ std::string GetEapPhase2Auth() const;
std::string GetEapServerCaCertPEM() const;
bool GetEapUseSystemCas() const;
std::string GetEapClientCertPkcs11Id() const;
std::string GetEapIdentity() const;
std::string GetEapAnonymousIdentity() const;
+ // Fill in |properties| with the appropriate values.
+ void SetEapProperties(base::DictionaryValue* properties);
+
// Returns true if the EAP method requires a user certificate.
bool UserCertRequired() const;
@@ -174,6 +184,8 @@ class WifiConfigView : public ChildNetworkConfigView,
views::ToggleImageButton* passphrase_visible_button_;
views::Label* error_label_;
+ base::WeakPtrFactory<WifiConfigView> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(WifiConfigView);
};

Powered by Google App Engine
This is Rietveld 408576698