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

Side by Side Diff: chrome/browser/policy/network_configuration_updater.h

Issue 10868076: Only import certificates with Web trust from ONC if the user is managed and matches the enterprise … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed upload Created 8 years, 3 months 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) 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 #ifndef CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ 5 #ifndef CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
6 #define CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ 6 #define CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/chromeos/cros/network_ui_data.h" 10 #include "chrome/browser/chromeos/cros/network_ui_data.h"
11 #include "chrome/browser/policy/policy_service.h" 11 #include "chrome/browser/policy/policy_service.h"
12 12
13 namespace base { 13 namespace base {
14 class Value; 14 class Value;
15 } 15 }
16 16
17 namespace chromeos { 17 namespace chromeos {
18 class NetworkLibrary; 18 class NetworkLibrary;
19 } 19 }
20 20
21 namespace policy { 21 namespace policy {
22 22
23 class PolicyMap; 23 class PolicyMap;
24 24
25 // Keeps track of the network configuration policy settings and updates the 25 // Keeps track of the network configuration policy settings and updates the
26 // network definitions whenever the configuration changes. 26 // network definitions whenever the configuration changes.
27 class NetworkConfigurationUpdater { 27 class NetworkConfigurationUpdater {
28 public: 28 public:
29 // Web trust isn't given to certificates imported from ONC by default.
30 // Setting |allow_web_trust| to true allows giving Web trust to the
31 // certificates that request it.
29 NetworkConfigurationUpdater(PolicyService* policy_service, 32 NetworkConfigurationUpdater(PolicyService* policy_service,
30 chromeos::NetworkLibrary* network_library); 33 chromeos::NetworkLibrary* network_library,
34 bool allow_web_trust);
31 virtual ~NetworkConfigurationUpdater(); 35 virtual ~NetworkConfigurationUpdater();
32 36
33 // Empty network configuration blob. 37 // Empty network configuration blob.
34 static const char kEmptyConfiguration[]; 38 static const char kEmptyConfiguration[];
35 39
36 private: 40 private:
37 // Extracts ONC string from |policy_map| and pushes the configuration to 41 // Extracts ONC string from |policy_map| and pushes the configuration to
38 // |network_library_| if it's different from |*cached_value| (which is 42 // |network_library_| if it's different from |*cached_value| (which is
39 // updated). 43 // updated).
40 void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source, 44 void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source,
41 std::string* cached_value, 45 std::string* cached_value,
42 const base::Value* previous, 46 const base::Value* previous,
43 const base::Value* current); 47 const base::Value* current);
44 48
45 // Wraps the policy service we read network configuration from. 49 // Wraps the policy service we read network configuration from.
46 PolicyChangeRegistrar policy_change_registrar_; 50 PolicyChangeRegistrar policy_change_registrar_;
47 51
48 // Network library to write network configuration to. 52 // Network library to write network configuration to.
49 chromeos::NetworkLibrary* network_library_; 53 chromeos::NetworkLibrary* network_library_;
50 54
55 // Whether Web trust is allowed or not.
56 bool allow_web_trust_;
57
51 // Current settings. 58 // Current settings.
52 std::string device_network_config_; 59 std::string device_network_config_;
53 std::string user_network_config_; 60 std::string user_network_config_;
54 61
55 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); 62 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater);
56 }; 63 };
57 64
58 } // namespace policy 65 } // namespace policy
59 66
60 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ 67 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698