| 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/enrollment_dialog_view.h" | 5 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 // static | 91 // static |
| 92 void EnrollmentDialogView::ShowDialog(gfx::NativeWindow owning_window, | 92 void EnrollmentDialogView::ShowDialog(gfx::NativeWindow owning_window, |
| 93 const std::string& network_name, | 93 const std::string& network_name, |
| 94 Profile* profile, | 94 Profile* profile, |
| 95 const GURL& target_uri, | 95 const GURL& target_uri, |
| 96 const base::Closure& connect) { | 96 const base::Closure& connect) { |
| 97 EnrollmentDialogView* dialog_view = | 97 EnrollmentDialogView* dialog_view = |
| 98 new EnrollmentDialogView(network_name, profile, target_uri, connect); | 98 new EnrollmentDialogView(network_name, profile, target_uri, connect); |
| 99 views::Widget::CreateWindowWithParent(dialog_view, owning_window); | 99 views::DialogDelegate::CreateDialogWidget(dialog_view, NULL, owning_window); |
| 100 dialog_view->InitDialog(); | 100 dialog_view->InitDialog(); |
| 101 views::Widget* widget = dialog_view->GetWidget(); | 101 views::Widget* widget = dialog_view->GetWidget(); |
| 102 DCHECK(widget); | 102 DCHECK(widget); |
| 103 widget->Show(); | 103 widget->Show(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 int EnrollmentDialogView::GetDialogButtons() const { | 106 int EnrollmentDialogView::GetDialogButtons() const { |
| 107 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; | 107 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 //////////////////////////////////////////////////////////////////////////////// | 246 //////////////////////////////////////////////////////////////////////////////// |
| 247 // Factory function. | 247 // Factory function. |
| 248 | 248 |
| 249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, | 249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, |
| 250 const std::string& network_name, | 250 const std::string& network_name, |
| 251 Profile* profile) { | 251 Profile* profile) { |
| 252 return new DialogEnrollmentDelegate(owning_window, network_name, profile); | 252 return new DialogEnrollmentDelegate(owning_window, network_name, profile); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace chromeos | 255 } // namespace chromeos |
| OLD | NEW |