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/options/vpn_config_view.h" | 5 #include "chrome/browser/chromeos/options/vpn_config_view.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
11 #include "chrome/browser/chromeos/cros/onc_constants.h" | 11 #include "chrome/browser/chromeos/cros/onc_constants.h" |
12 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 12 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" |
13 #include "chrome/common/net/x509_certificate_model.h" | 14 #include "chrome/common/net/x509_certificate_model.h" |
14 #include "grit/chromium_strings.h" | 15 #include "grit/chromium_strings.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 #include "grit/locale_settings.h" | 17 #include "grit/locale_settings.h" |
17 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
18 #include "net/base/cert_database.h" | 19 #include "net/base/cert_database.h" |
19 #include "net/base/x509_certificate.h" | 20 #include "net/base/x509_certificate.h" |
20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/models/combobox_model.h" | 22 #include "ui/base/models/combobox_model.h" |
22 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 vpn->SetOpenVPNCredentials(GetUserCertID(), | 344 vpn->SetOpenVPNCredentials(GetUserCertID(), |
344 GetUsername(), | 345 GetUsername(), |
345 GetUserPassphrase(), | 346 GetUserPassphrase(), |
346 GetOTP()); | 347 GetOTP()); |
347 break; | 348 break; |
348 } | 349 } |
349 case PROVIDER_TYPE_MAX: | 350 case PROVIDER_TYPE_MAX: |
350 break; | 351 break; |
351 } | 352 } |
352 vpn->SetEnrollmentDelegate( | 353 vpn->SetEnrollmentDelegate( |
353 EnrollmentDialogView::CreateEnrollmentDelegate( | 354 CreateEnrollmentDelegate(GetWidget()->GetNativeWindow(), |
354 GetWidget()->GetNativeWindow())); | 355 ProfileManager::GetLastUsedProfile())); |
355 cros->ConnectToVirtualNetwork(vpn); | 356 cros->ConnectToVirtualNetwork(vpn); |
356 } | 357 } |
357 // Connection failures are responsible for updating the UI, including | 358 // Connection failures are responsible for updating the UI, including |
358 // reopening dialogs. | 359 // reopening dialogs. |
359 return true; // Close dialog. | 360 return true; // Close dialog. |
360 } | 361 } |
361 | 362 |
362 void VPNConfigView::Cancel() { | 363 void VPNConfigView::Cancel() { |
363 } | 364 } |
364 | 365 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 std::string vpn_type; | 864 std::string vpn_type; |
864 if (!vpn_dict || !vpn_dict->GetString(onc::kType, &vpn_type)) | 865 if (!vpn_dict || !vpn_dict->GetString(onc::kType, &vpn_type)) |
865 return; | 866 return; |
866 | 867 |
867 property_ui_data->ParseOncProperty( | 868 property_ui_data->ParseOncProperty( |
868 network->ui_data(), onc, | 869 network->ui_data(), onc, |
869 base::StringPrintf("%s.%s.%s", onc::kVPN, vpn_type.c_str(), key.c_str())); | 870 base::StringPrintf("%s.%s.%s", onc::kVPN, vpn_type.c_str(), key.c_str())); |
870 } | 871 } |
871 | 872 |
872 } // namespace chromeos | 873 } // namespace chromeos |
OLD | NEW |