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

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 "base/memory/weak_ptr.h"
9
10 class PrefRegistrySimple;
11 class Profile;
12
13 namespace chromeos {
14
15 namespace network_throttling_observer {
16
17 void RegisterPrefs(PrefRegistrySimple* registry);
18 }
19
20 // Helper class that listens for changes in network throttling
21 // policy, and propagates them down to shill (the network manager).
22 // Call-flow: NetworkThrottlingObserver
23 // -> NetworkStateHandler
24 // -> ShillManagerClient
25 class NetworkThrottlingObserver {
Andrew T Wilson (Slow) 2016/10/21 13:27:30 This is a weird class - it's owned by ChromeBrowse
stevenjb 2016/10/21 19:41:20 +1. We generally use one of two patterns: 1) The
stevenjb 2016/10/21 20:25:54 If we make this a pref observer we shouldn't need
kirtika1 2016/10/23 00:04:49 Done, used (1)
kirtika1 2016/10/23 00:04:49 Thanks for that suggestion!Done.
26 public:
27 NetworkThrottlingObserver();
28 ~NetworkThrottlingObserver();
29
30 static NetworkThrottlingObserver* Get();
31
32 // Should be called whenever the network throttling policy changes
33 void OnPreferenceChanged(bool throttling_enabled,
34 uint32_t upload_rate_kbits,
35 uint32_t download_rate_kbits);
36
37 private:
38 base::WeakPtrFactory<NetworkThrottlingObserver> weak_ptr_factory_;
39
40 DISALLOW_COPY_AND_ASSIGN(NetworkThrottlingObserver);
41 };
42
43 } // namespace chromeos
44
45 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_THROTTLING_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698