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

Unified Diff: chromeos/network/shill_property_handler.h

Issue 1431563005: Handle prohibited technologies in device policy ONC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove dependencies for NetworkHandler in ShillPropertyHandlerTest.ProhibitedTechnologies Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/network/shill_property_handler.h
diff --git a/chromeos/network/shill_property_handler.h b/chromeos/network/shill_property_handler.h
index 8b2cd42732217a63e9f855e211c72dc0b191ed65..422b3ed1841fbf2f0e0b0e4ee9c0536cf7259aee 100644
--- a/chromeos/network/shill_property_handler.h
+++ b/chromeos/network/shill_property_handler.h
@@ -9,12 +9,15 @@
#include <map>
#include <set>
#include <string>
+#include <vector>
#include "base/memory/weak_ptr.h"
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/shill_property_changed_observer.h"
+#include "chromeos/login/login_state.h"
#include "chromeos/network/managed_state.h"
#include "chromeos/network/network_handler_callbacks.h"
+#include "chromeos/network/network_policy_observer.h"
namespace base {
class DictionaryValue;
@@ -39,7 +42,8 @@ class ShillPropertyObserver;
// This class must not outlive the ShillManagerClient instance.
class CHROMEOS_EXPORT ShillPropertyHandler
: public ShillPropertyChangedObserver,
- public base::SupportsWeakPtr<ShillPropertyHandler> {
+ public base::SupportsWeakPtr<ShillPropertyHandler>,
+ public LoginState::Observer {
stevenjb 2015/11/10 21:40:21 I really don't like adding this dependency here, o
fqj 2015/11/11 16:53:55 Done.
public:
typedef std::map<std::string, ShillPropertyObserver*>
ShillPropertyObserverMap;
@@ -109,6 +113,9 @@ class CHROMEOS_EXPORT ShillPropertyHandler
// ServiceCompleteList).
void UpdateManagerProperties();
+ // LoginState::Observer
+ void LoggedInStateChanged() override;
+
// Returns true if |technology| is available, enabled, etc.
bool IsTechnologyAvailable(const std::string& technology) const;
bool IsTechnologyEnabled(const std::string& technology) const;
@@ -122,6 +129,13 @@ class CHROMEOS_EXPORT ShillPropertyHandler
bool enabled,
const network_handler::ErrorCallback& error_callback);
+ // Asynchronously sets the prohibited state for every network technology
+ // listed in |technologies|. Note: Modifies Manager state. Calls
+ // |error_callback| on failure.
+ void SetProhibitedTechnologies(
+ const std::vector<std::string>& technologies,
+ const network_handler::ErrorCallback& error_callback);
+
// Sets the list of devices on which portal check is enabled.
void SetCheckPortalList(const std::string& check_portal_list);
@@ -140,6 +154,9 @@ class CHROMEOS_EXPORT ShillPropertyHandler
void OnPropertyChanged(const std::string& key,
const base::Value& value) override;
+ // Called when user policy is applied
+ void UserPolicyApplied();
+
private:
typedef std::map<ManagedState::ManagedType, std::set<std::string> >
TypeRequestMap;
@@ -214,6 +231,14 @@ class CHROMEOS_EXPORT ShillPropertyHandler
DBusMethodCallStatus call_status,
const base::DictionaryValue& properties);
+ void SetProhibitedTechnologiesEnforced(bool enforced);
+
+ // Is user logged in
+ bool in_user_session_;
+
+ // Is user policy applied
+ bool user_policy_applied_;
+
// Pointer to containing class (owns this)
Listener* listener_;
@@ -237,6 +262,7 @@ class CHROMEOS_EXPORT ShillPropertyHandler
std::set<std::string> available_technologies_;
std::set<std::string> enabled_technologies_;
std::set<std::string> enabling_technologies_;
+ std::set<std::string> prohibited_technologies_;
std::set<std::string> uninitialized_technologies_;
DISALLOW_COPY_AND_ASSIGN(ShillPropertyHandler);

Powered by Google App Engine
This is Rietveld 408576698