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/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/browser/ui/browser_finder.h" | 12 #include "chrome/browser/ui/browser_finder.h" |
13 #include "chrome/browser/ui/browser_navigator.h" | 13 #include "chrome/browser/ui/browser_navigator.h" |
14 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
15 #include "chromeos/network/client_cert_util.h" | 15 #include "chromeos/network/client_cert_util.h" |
16 #include "chromeos/network/managed_network_configuration_handler.h" | 16 #include "chromeos/network/managed_network_configuration_handler.h" |
17 #include "chromeos/network/network_event_log.h" | 17 #include "chromeos/network/network_event_log.h" |
18 #include "chromeos/network/network_state.h" | 18 #include "chromeos/network/network_state.h" |
19 #include "chromeos/network/network_state_handler.h" | 19 #include "chromeos/network/network_state_handler.h" |
20 #include "content/public/common/page_transition_types.h" | |
21 #include "extensions/browser/extension_host.h" | 20 #include "extensions/browser/extension_host.h" |
22 #include "extensions/common/constants.h" | 21 #include "extensions/common/constants.h" |
23 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/page_transition_types.h" |
24 #include "ui/views/controls/label.h" | 24 #include "ui/views/controls/label.h" |
25 #include "ui/views/layout/grid_layout.h" | 25 #include "ui/views/layout/grid_layout.h" |
26 #include "ui/views/layout/layout_constants.h" | 26 #include "ui/views/layout/layout_constants.h" |
27 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
28 #include "ui/views/window/dialog_delegate.h" | 28 #include "ui/views/window/dialog_delegate.h" |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool EnrollmentDialogView::Accept() { | 117 bool EnrollmentDialogView::Accept() { |
118 accepted_ = true; | 118 accepted_ = true; |
119 return true; | 119 return true; |
120 } | 120 } |
121 | 121 |
122 void EnrollmentDialogView::OnClosed() { | 122 void EnrollmentDialogView::OnClosed() { |
123 if (!accepted_) | 123 if (!accepted_) |
124 return; | 124 return; |
125 chrome::NavigateParams params(profile_, | 125 chrome::NavigateParams params(profile_, |
126 GURL(target_uri_), | 126 GURL(target_uri_), |
127 content::PAGE_TRANSITION_LINK); | 127 ui::PAGE_TRANSITION_LINK); |
128 params.disposition = NEW_FOREGROUND_TAB; | 128 params.disposition = NEW_FOREGROUND_TAB; |
129 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 129 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
130 chrome::Navigate(¶ms); | 130 chrome::Navigate(¶ms); |
131 } | 131 } |
132 | 132 |
133 base::string16 EnrollmentDialogView::GetDialogButtonLabel( | 133 base::string16 EnrollmentDialogView::GetDialogButtonLabel( |
134 ui::DialogButton button) const { | 134 ui::DialogButton button) const { |
135 if (button == ui::DIALOG_BUTTON_OK) | 135 if (button == ui::DIALOG_BUTTON_OK) |
136 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_BUTTON); | 136 return l10n_util::GetStringUTF16(IDS_NETWORK_ENROLLMENT_HANDLER_BUTTON); |
137 return views::DialogDelegateView::GetDialogButtonLabel(button); | 137 return views::DialogDelegateView::GetDialogButtonLabel(button); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 DialogEnrollmentDelegate* enrollment = | 301 DialogEnrollmentDelegate* enrollment = |
302 new DialogEnrollmentDelegate(owning_window, network->name(), profile); | 302 new DialogEnrollmentDelegate(owning_window, network->name(), profile); |
303 return enrollment->Enroll(cert_config.pattern.enrollment_uri_list(), | 303 return enrollment->Enroll(cert_config.pattern.enrollment_uri_list(), |
304 base::Bind(&EnrollmentComplete, service_path)); | 304 base::Bind(&EnrollmentComplete, service_path)); |
305 } | 305 } |
306 | 306 |
307 } // namespace enrollment | 307 } // namespace enrollment |
308 | 308 |
309 } // namespace chromeos | 309 } // namespace chromeos |
OLD | NEW |