summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/options
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/options')
-rw-r--r--chrome/browser/chromeos/options/network_config_view.cc14
-rw-r--r--chrome/browser/chromeos/options/network_config_view.h14
2 files changed, 24 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc
index f5aa05e..e3ea604 100644
--- a/chrome/browser/chromeos/options/network_config_view.cc
+++ b/chrome/browser/chromeos/options/network_config_view.cc
@@ -25,7 +25,8 @@ NetworkConfigView::NetworkConfigView(EthernetNetwork ethernet)
flags_(FLAG_ETHERNET | FLAG_SHOW_IPCONFIG),
ethernet_(ethernet),
wificonfig_view_(NULL),
- ipconfig_view_(NULL) {
+ ipconfig_view_(NULL),
+ delegate_(NULL) {
}
NetworkConfigView::NetworkConfigView(WifiNetwork wifi, bool login_only)
@@ -33,7 +34,8 @@ NetworkConfigView::NetworkConfigView(WifiNetwork wifi, bool login_only)
flags_(FLAG_WIFI),
wifi_(wifi),
wificonfig_view_(NULL),
- ipconfig_view_(NULL) {
+ ipconfig_view_(NULL),
+ delegate_(NULL) {
if (login_only)
flags_ |= FLAG_LOGIN_ONLY;
else
@@ -45,14 +47,16 @@ NetworkConfigView::NetworkConfigView(CellularNetwork cellular)
flags_(FLAG_CELLULAR | FLAG_SHOW_IPCONFIG),
cellular_(cellular),
wificonfig_view_(NULL),
- ipconfig_view_(NULL) {
+ ipconfig_view_(NULL),
+ delegate_(NULL) {
}
NetworkConfigView::NetworkConfigView()
: browser_mode_(true),
flags_(FLAG_WIFI | FLAG_LOGIN_ONLY | FLAG_OTHER_NETWORK),
wificonfig_view_(NULL),
- ipconfig_view_(NULL) {
+ ipconfig_view_(NULL),
+ delegate_(NULL) {
}
gfx::NativeWindow NetworkConfigView::GetNativeWindow() const {
@@ -79,6 +83,8 @@ bool NetworkConfigView::IsDialogButtonEnabled(
}
bool NetworkConfigView::Cancel() {
+ if (delegate_)
+ delegate_->OnDialogCancelled();
return true;
}
diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h
index 3b42abd..6a2653e 100644
--- a/chrome/browser/chromeos/options/network_config_view.h
+++ b/chrome/browser/chromeos/options/network_config_view.h
@@ -28,6 +28,14 @@ class NetworkConfigView : public views::View,
public views::DialogDelegate,
views::TabbedPane::Listener {
public:
+ class Delegate {
+ public:
+ // Called when dialog "Cancel" button is pressed.
+ virtual void OnDialogCancelled() = 0;
+ protected:
+ virtual ~Delegate() {}
+ };
+
// Configure dialog for ethernet.
explicit NetworkConfigView(EthernetNetwork ethernet);
// Configure dialog for wifi. If |login_only|, then only show login tab.
@@ -70,6 +78,10 @@ class NetworkConfigView : public views::View,
return browser_mode_;
}
+ void set_delegate(Delegate* delegate) {
+ delegate_ = delegate;
+ }
+
protected:
// views::View overrides:
virtual void Layout();
@@ -106,6 +118,8 @@ class NetworkConfigView : public views::View,
WifiConfigView* wificonfig_view_;
IPConfigView* ipconfig_view_;
+ Delegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(NetworkConfigView);
};