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

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: . 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 class UserManager;
19 } 20 }
20 21
21 namespace policy { 22 namespace policy {
22 23
24 class BrowserPolicyConnector;
23 class PolicyMap; 25 class PolicyMap;
24 26
25 // Keeps track of the network configuration policy settings and updates the 27 // Keeps track of the network configuration policy settings and updates the
26 // network definitions whenever the configuration changes. 28 // network definitions whenever the configuration changes.
27 class NetworkConfigurationUpdater { 29 class NetworkConfigurationUpdater {
28 public: 30 public:
29 NetworkConfigurationUpdater(PolicyService* policy_service, 31 NetworkConfigurationUpdater(PolicyService* policy_service,
30 chromeos::NetworkLibrary* network_library); 32 BrowserPolicyConnector* connector,
33 chromeos::NetworkLibrary* network_library,
34 chromeos::UserManager* user_manager);
Mattias Nissler (ping if slow) 2012/08/28 11:57:56 These are some heavy-weight dependencies (and inde
Joao da Silva 2012/09/03 15:24:32 Done, moved the logic to chrome_browser_main_chrom
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
52 // Used to determine the user affiliation.
53 BrowserPolicyConnector* connector_;
54
48 // Network library to write network configuration to. 55 // Network library to write network configuration to.
49 chromeos::NetworkLibrary* network_library_; 56 chromeos::NetworkLibrary* network_library_;
50 57
58 // Used to determine if a user is logged in.
59 chromeos::UserManager* user_manager_;
60
51 // Current settings. 61 // Current settings.
52 std::string device_network_config_; 62 std::string device_network_config_;
53 std::string user_network_config_; 63 std::string user_network_config_;
54 64
55 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); 65 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater);
56 }; 66 };
57 67
58 } // namespace policy 68 } // namespace policy
59 69
60 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ 70 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698