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

Side by Side Diff: chrome/browser/chromeos/net/network_throttling_observer.h

Issue 2364703002: Add network throttling as an enterprise policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add network bandwidth throttling as an enterprise policy Created 4 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
7
8 #include <string>
9
10 #include "base/memory/weak_ptr.h"
11 #include "components/prefs/pref_change_registrar.h"
12
13 class PrefRegistrySimple;
14 class Profile;
15
16 namespace chromeos {
17
18 // NetworkThrottlingObserver is a singleton, owned by
19 // ChromeBrowserMainPartsChromeos.
20 // This class is responsible for propagating network bandwidth throttling policy
21 // changes (prefs::kNetworkThrottlingEnabled) in Chrome down to Shill which
22 // implements by calling 'tc' in the kernel.
23 class NetworkThrottlingObserver {
24 public:
25 explicit NetworkThrottlingObserver(PrefService* local_state);
26 ~NetworkThrottlingObserver();
27
28 static void RegisterPrefs(PrefRegistrySimple* registry);
29
30 private:
31 // Callback used when prefs::kNetworkThrottlingEnabled changes
32 void OnPreferenceChanged(const std::string& pref_name);
33
34 PrefService* local_state_;
35 PrefChangeRegistrar pref_change_registrar_;
36
37 DISALLOW_COPY_AND_ASSIGN(NetworkThrottlingObserver);
38 };
39
40 } // namespace chromeos
41
42 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698