| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" | 5 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h" | 8 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h" |
| 9 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" | 9 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" |
| 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 Close(); | 67 Close(); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 if (GetState() == STATE_DISPLAYED) // Dialog is already shown, do nothing. | 71 if (GetState() == STATE_DISPLAYED) // Dialog is already shown, do nothing. |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 InitCaptivePortalView(); | 74 InitCaptivePortalView(); |
| 75 | 75 |
| 76 CaptivePortalView* portal = captive_portal_view_.release(); | 76 CaptivePortalView* portal = captive_portal_view_.release(); |
| 77 auto manager = | 77 auto* manager = |
| 78 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); | 78 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_); |
| 79 widget_ = CreateWindowAsFramelessChild( | 79 widget_ = CreateWindowAsFramelessChild( |
| 80 portal, | 80 portal, |
| 81 manager->delegate()->GetWebContentsModalDialogHost()->GetHostView()); | 81 manager->delegate()->GetWebContentsModalDialogHost()->GetHostView()); |
| 82 portal->Init(); | 82 portal->Init(); |
| 83 widget_->AddObserver(this); | 83 widget_->AddObserver(this); |
| 84 manager->ShowModalDialog(widget_->GetNativeView()); | 84 manager->ShowModalDialog(widget_->GetNativeView()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void CaptivePortalWindowProxy::Close() { | 87 void CaptivePortalWindowProxy::Close() { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { | 155 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { |
| 156 if (!widget_ || widget_ != widget) | 156 if (!widget_ || widget_ != widget) |
| 157 return; | 157 return; |
| 158 widget_->RemoveObserver(this); | 158 widget_->RemoveObserver(this); |
| 159 widget_ = NULL; | 159 widget_ = NULL; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace chromeos | 162 } // namespace chromeos |
| OLD | NEW |