OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/captive_portal_window_proxy.h" | 5 #include "chrome/browser/chromeos/login/captive_portal_window_proxy.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/login/captive_portal_view.h" | 7 #include "chrome/browser/chromeos/login/captive_portal_view.h" |
8 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 8 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
10 #include "components/web_modal/web_contents_modal_dialog_host.h" | 10 #include "components/web_modal/web_contents_modal_dialog_host.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 DCHECK(web_contents_modal_dialog_manager); | 60 DCHECK(web_contents_modal_dialog_manager); |
61 WebContentsModalDialogManagerDelegate* delegate = | 61 WebContentsModalDialogManagerDelegate* delegate = |
62 web_contents_modal_dialog_manager->delegate(); | 62 web_contents_modal_dialog_manager->delegate(); |
63 DCHECK(delegate); | 63 DCHECK(delegate); |
64 widget_ = views::Widget::CreateWindowAsFramelessChild( | 64 widget_ = views::Widget::CreateWindowAsFramelessChild( |
65 captive_portal_view, | 65 captive_portal_view, |
66 delegate->GetWebContentsModalDialogHost()->GetHostView()); | 66 delegate->GetWebContentsModalDialogHost()->GetHostView()); |
67 captive_portal_view->Init(); | 67 captive_portal_view->Init(); |
68 | 68 |
69 widget_->AddObserver(this); | 69 widget_->AddObserver(this); |
70 web_contents_modal_dialog_manager->ShowDialog(widget_->GetNativeView()); | 70 web_contents_modal_dialog_manager->ShowModalDialog( |
| 71 widget_->GetNativeView()); |
71 DCHECK(GetState() == STATE_DISPLAYED); | 72 DCHECK(GetState() == STATE_DISPLAYED); |
72 } | 73 } |
73 | 74 |
74 void CaptivePortalWindowProxy::Close() { | 75 void CaptivePortalWindowProxy::Close() { |
75 if (GetState() == STATE_DISPLAYED) | 76 if (GetState() == STATE_DISPLAYED) |
76 widget_->Close(); | 77 widget_->Close(); |
77 captive_portal_view_.reset(); | 78 captive_portal_view_.reset(); |
78 captive_portal_view_for_testing_ = NULL; | 79 captive_portal_view_for_testing_ = NULL; |
79 } | 80 } |
80 | 81 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 133 } |
133 | 134 |
134 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { | 135 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { |
135 if (!widget_ || widget_ != widget) | 136 if (!widget_ || widget_ != widget) |
136 return; | 137 return; |
137 widget_->RemoveObserver(this); | 138 widget_->RemoveObserver(this); |
138 widget_ = NULL; | 139 widget_ = NULL; |
139 } | 140 } |
140 | 141 |
141 } // namespace chromeos | 142 } // namespace chromeos |
OLD | NEW |