OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/cros/network_library.h" | 5 #include "chrome/browser/chromeos/cros/network_library.h" |
6 | 6 |
7 #include <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
8 #include <dbus/dbus-gtype-specialized.h> | 8 #include <dbus/dbus-gtype-specialized.h> |
9 #include <glib-object.h> | 9 #include <glib-object.h> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/chromeos/cros_settings.h" | 31 #include "chrome/browser/chromeos/cros_settings.h" |
32 #include "chrome/browser/chromeos/cros/cros_library.h" | 32 #include "chrome/browser/chromeos/cros/cros_library.h" |
33 #include "chrome/browser/chromeos/cros/native_network_constants.h" | 33 #include "chrome/browser/chromeos/cros/native_network_constants.h" |
34 #include "chrome/browser/chromeos/cros/native_network_parser.h" | 34 #include "chrome/browser/chromeos/cros/native_network_parser.h" |
35 #include "chrome/browser/chromeos/cros/onc_network_parser.h" | 35 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
36 #include "chrome/browser/chromeos/network_login_observer.h" | 36 #include "chrome/browser/chromeos/network_login_observer.h" |
37 #include "chrome/common/time_format.h" | 37 #include "chrome/common/time_format.h" |
38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
39 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN. | 39 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN. |
40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
| 41 #include "net/base/x509_certificate.h" |
41 #include "third_party/cros_system_api/dbus/service_constants.h" | 42 #include "third_party/cros_system_api/dbus/service_constants.h" |
42 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
43 #include "ui/base/text/bytes_formatting.h" | 44 #include "ui/base/text/bytes_formatting.h" |
44 | 45 |
45 using content::BrowserThread; | 46 using content::BrowserThread; |
46 | 47 |
47 //////////////////////////////////////////////////////////////////////////////// | 48 //////////////////////////////////////////////////////////////////////////////// |
48 // Implementation notes. | 49 // Implementation notes. |
49 // NetworkLibraryImpl manages a series of classes that describe network devices | 50 // NetworkLibraryImpl manages a series of classes that describe network devices |
50 // and services: | 51 // and services: |
(...skipping 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2815 break; | 2816 break; |
2816 } | 2817 } |
2817 } | 2818 } |
2818 } | 2819 } |
2819 | 2820 |
2820 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob) { | 2821 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob) { |
2821 OncNetworkParser parser(onc_blob); | 2822 OncNetworkParser parser(onc_blob); |
2822 | 2823 |
2823 for (int i = 0; i < parser.GetCertificatesSize(); i++) { | 2824 for (int i = 0; i < parser.GetCertificatesSize(); i++) { |
2824 // Insert each of the available certs into the certificate DB. | 2825 // Insert each of the available certs into the certificate DB. |
2825 if (!parser.ParseCertificate(i)) { | 2826 if (parser.ParseCertificate(i).get() == NULL) { |
2826 DLOG(WARNING) << "Cannot parse certificate in ONC file"; | 2827 DLOG(WARNING) << "Cannot parse certificate in ONC file"; |
2827 return false; | 2828 return false; |
2828 } | 2829 } |
2829 } | 2830 } |
2830 | 2831 |
2831 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) { | 2832 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) { |
2832 // Parse Open Network Configuration blob into a temporary Network object. | 2833 // Parse Open Network Configuration blob into a temporary Network object. |
2833 scoped_ptr<Network> network(parser.ParseNetwork(i)); | 2834 scoped_ptr<Network> network(parser.ParseNetwork(i)); |
2834 if (!network.get()) { | 2835 if (!network.get()) { |
2835 DLOG(WARNING) << "Cannot parse networks in ONC file"; | 2836 DLOG(WARNING) << "Cannot parse networks in ONC file"; |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5253 return impl; | 5254 return impl; |
5254 } | 5255 } |
5255 | 5256 |
5256 ///////////////////////////////////////////////////////////////////////////// | 5257 ///////////////////////////////////////////////////////////////////////////// |
5257 | 5258 |
5258 } // namespace chromeos | 5259 } // namespace chromeos |
5259 | 5260 |
5260 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 5261 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
5261 // won't be deleted until its last InvokeLater is run. | 5262 // won't be deleted until its last InvokeLater is run. |
5262 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase); | 5263 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase); |
OLD | NEW |