Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1593)

Side by Side Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 8566056: This applies GUIDs to certificate and key nicknames when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review edits Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 19 matching lines...) Expand all
30 #include "chrome/browser/chromeos/cros_settings.h" 30 #include "chrome/browser/chromeos/cros_settings.h"
31 #include "chrome/browser/chromeos/cros/cros_library.h" 31 #include "chrome/browser/chromeos/cros/cros_library.h"
32 #include "chrome/browser/chromeos/cros/native_network_constants.h" 32 #include "chrome/browser/chromeos/cros/native_network_constants.h"
33 #include "chrome/browser/chromeos/cros/native_network_parser.h" 33 #include "chrome/browser/chromeos/cros/native_network_parser.h"
34 #include "chrome/browser/chromeos/cros/onc_network_parser.h" 34 #include "chrome/browser/chromeos/cros/onc_network_parser.h"
35 #include "chrome/browser/chromeos/network_login_observer.h" 35 #include "chrome/browser/chromeos/network_login_observer.h"
36 #include "chrome/common/time_format.h" 36 #include "chrome/common/time_format.h"
37 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
38 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN. 38 #include "crypto/nss_util.h" // crypto::GetTPMTokenInfo() for 802.1X and VPN.
39 #include "grit/generated_resources.h" 39 #include "grit/generated_resources.h"
40 #include "net/base/x509_certificate.h"
40 #include "third_party/cros_system_api/dbus/service_constants.h" 41 #include "third_party/cros_system_api/dbus/service_constants.h"
41 #include "ui/base/l10n/l10n_util.h" 42 #include "ui/base/l10n/l10n_util.h"
42 #include "ui/base/text/bytes_formatting.h" 43 #include "ui/base/text/bytes_formatting.h"
43 44
44 using content::BrowserThread; 45 using content::BrowserThread;
45 46
46 //////////////////////////////////////////////////////////////////////////////// 47 ////////////////////////////////////////////////////////////////////////////////
47 // Implementation notes. 48 // Implementation notes.
48 // NetworkLibraryImpl manages a series of classes that describe network devices 49 // NetworkLibraryImpl manages a series of classes that describe network devices
49 // and services: 50 // and services:
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after
2776 break; 2777 break;
2777 } 2778 }
2778 } 2779 }
2779 } 2780 }
2780 2781
2781 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob) { 2782 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob) {
2782 OncNetworkParser parser(onc_blob); 2783 OncNetworkParser parser(onc_blob);
2783 2784
2784 for (int i = 0; i < parser.GetCertificatesSize(); i++) { 2785 for (int i = 0; i < parser.GetCertificatesSize(); i++) {
2785 // Insert each of the available certs into the certificate DB. 2786 // Insert each of the available certs into the certificate DB.
2786 if (!parser.ParseCertificate(i)) { 2787 if (parser.ParseCertificate(i).get() == NULL) {
2787 DLOG(WARNING) << "Cannot parse certificate in ONC file"; 2788 DLOG(WARNING) << "Cannot parse certificate in ONC file";
2788 return false; 2789 return false;
2789 } 2790 }
2790 } 2791 }
2791 2792
2792 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) { 2793 for (int i = 0; i < parser.GetNetworkConfigsSize(); i++) {
2793 // Parse Open Network Configuration blob into a temporary Network object. 2794 // Parse Open Network Configuration blob into a temporary Network object.
2794 Network* network = parser.ParseNetwork(i); 2795 Network* network = parser.ParseNetwork(i);
2795 if (!network) { 2796 if (!network) {
2796 DLOG(WARNING) << "Cannot parse networks in ONC file"; 2797 DLOG(WARNING) << "Cannot parse networks in ONC file";
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after
5159 return impl; 5160 return impl;
5160 } 5161 }
5161 5162
5162 ///////////////////////////////////////////////////////////////////////////// 5163 /////////////////////////////////////////////////////////////////////////////
5163 5164
5164 } // namespace chromeos 5165 } // namespace chromeos
5165 5166
5166 // Allows InvokeLater without adding refcounting. This class is a Singleton and 5167 // Allows InvokeLater without adding refcounting. This class is a Singleton and
5167 // won't be deleted until its last InvokeLater is run. 5168 // won't be deleted until its last InvokeLater is run.
5168 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase); 5169 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImplBase);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698