| Index: chrome/browser/supervised_user/supervised_user_url_filter.h
|
| diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.h b/chrome/browser/supervised_user/supervised_user_url_filter.h
|
| index 0b34d37f47912678b09440bfab1f78c60623197f..e11c50cc6159d9a3379319d7db2e1365ae53590d 100644
|
| --- a/chrome/browser/supervised_user/supervised_user_url_filter.h
|
| +++ b/chrome/browser/supervised_user/supervised_user_url_filter.h
|
| @@ -61,7 +61,11 @@ class SupervisedUserURLFilter
|
|
|
| class Observer {
|
| public:
|
| + // Called whenever the filter changes.
|
| + // TODO(treib,bauerb): Rename to OnURLFilterUpdated.
|
| virtual void OnSiteListUpdated() = 0;
|
| + // Called whenever a check started via
|
| + // GetFilteringBehaviorForURLWithAsyncChecks completes.
|
| virtual void OnURLChecked(
|
| const GURL& url,
|
| FilteringBehavior behavior,
|
| @@ -106,6 +110,13 @@ class SupervisedUserURLFilter
|
| static bool HostMatchesPattern(const std::string& canonical_host,
|
| const std::string& pattern);
|
|
|
| + // Returns whether the filter is enabled. If this is false, all URL checks
|
| + // will return ALLOW.
|
| + bool enabled() const { return enabled_; }
|
| +
|
| + // Enables or disables the filter. Notifies observers if the state changed.
|
| + void SetEnabled(bool enabled);
|
| +
|
| // Returns the filtering behavior for a given URL, based on the default
|
| // behavior and whether it is on a site list.
|
| FilteringBehavior GetFilteringBehaviorForURL(const GURL& url) const;
|
| @@ -198,6 +209,10 @@ class SupervisedUserURLFilter
|
| // This is mutable to allow notification in const member functions.
|
| mutable base::ObserverList<Observer> observers_;
|
|
|
| + // Whether this filter is enabled. True for supervised user profiles, false
|
| + // otherwise.
|
| + bool enabled_;
|
| +
|
| FilteringBehavior default_behavior_;
|
| std::unique_ptr<Contents> contents_;
|
|
|
|
|