| 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" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/browser_navigator.h" | 12 #include "chrome/browser/ui/browser_navigator.h" |
| 13 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 13 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
| 14 #include "extensions/common/constants.h" | 15 #include "extensions/common/constants.h" |
| 15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/views/controls/label.h" | 19 #include "ui/views/controls/label.h" |
| 19 #include "ui/views/layout/grid_layout.h" | 20 #include "ui/views/layout/grid_layout.h" |
| 20 #include "ui/views/layout/layout_constants.h" | 21 #include "ui/views/layout/layout_constants.h" |
| 21 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 22 #include "ui/views/window/dialog_delegate.h" | 23 #include "ui/views/window/dialog_delegate.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 90 } |
| 90 | 91 |
| 91 // static | 92 // static |
| 92 void EnrollmentDialogView::ShowDialog(gfx::NativeWindow owning_window, | 93 void EnrollmentDialogView::ShowDialog(gfx::NativeWindow owning_window, |
| 93 const std::string& network_name, | 94 const std::string& network_name, |
| 94 Profile* profile, | 95 Profile* profile, |
| 95 const GURL& target_uri, | 96 const GURL& target_uri, |
| 96 const base::Closure& connect) { | 97 const base::Closure& connect) { |
| 97 EnrollmentDialogView* dialog_view = | 98 EnrollmentDialogView* dialog_view = |
| 98 new EnrollmentDialogView(network_name, profile, target_uri, connect); | 99 new EnrollmentDialogView(network_name, profile, target_uri, connect); |
| 99 views::DialogDelegate::CreateDialogWidget(dialog_view, NULL, owning_window); | 100 CreateBrowserModalDialogViews(dialog_view, owning_window); |
| 100 dialog_view->InitDialog(); | 101 dialog_view->InitDialog(); |
| 101 views::Widget* widget = dialog_view->GetWidget(); | 102 views::Widget* widget = dialog_view->GetWidget(); |
| 102 DCHECK(widget); | 103 DCHECK(widget); |
| 103 widget->Show(); | 104 widget->Show(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 int EnrollmentDialogView::GetDialogButtons() const { | 107 int EnrollmentDialogView::GetDialogButtons() const { |
| 107 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; | 108 return ui::DIALOG_BUTTON_CANCEL | ui::DIALOG_BUTTON_OK; |
| 108 } | 109 } |
| 109 | 110 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 //////////////////////////////////////////////////////////////////////////////// | 247 //////////////////////////////////////////////////////////////////////////////// |
| 247 // Factory function. | 248 // Factory function. |
| 248 | 249 |
| 249 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, | 250 EnrollmentDelegate* CreateEnrollmentDelegate(gfx::NativeWindow owning_window, |
| 250 const std::string& network_name, | 251 const std::string& network_name, |
| 251 Profile* profile) { | 252 Profile* profile) { |
| 252 return new DialogEnrollmentDelegate(owning_window, network_name, profile); | 253 return new DialogEnrollmentDelegate(owning_window, network_name, profile); |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace chromeos | 256 } // namespace chromeos |
| OLD | NEW |