| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(), NULL, NULL); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void CaptivePortalWindowProxy::Close() { | 87 void CaptivePortalWindowProxy::Close() { |
| 88 if (GetState() == STATE_DISPLAYED) | 88 if (GetState() == STATE_DISPLAYED) |
| 89 widget_->Close(); | 89 widget_->Close(); |
| 90 captive_portal_view_.reset(); | 90 captive_portal_view_.reset(); |
| 91 captive_portal_view_for_testing_ = NULL; | 91 captive_portal_view_for_testing_ = NULL; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void CaptivePortalWindowProxy::OnRedirected() { | 94 void CaptivePortalWindowProxy::OnRedirected() { |
| (...skipping 58 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 |