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

Unified Diff: chrome/browser/managed_mode.h

Issue 10824257: Add ManagedModeURLFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile fix Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/managed_mode.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode.h
diff --git a/chrome/browser/managed_mode.h b/chrome/browser/managed_mode.h
index c77e16331b958d960a5fa480920e8ed3939ad46f..9d47a3395352ca4b6c053f8425b29188838523e6 100644
--- a/chrome/browser/managed_mode.h
+++ b/chrome/browser/managed_mode.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "chrome/browser/extensions/management_policy.h"
#include "chrome/browser/ui/browser_list_observer.h"
@@ -20,6 +21,7 @@
class Browser;
template<typename T>
struct DefaultSingletonTraits;
+class ManagedModeURLFilter;
class PrefService;
class Profile;
@@ -27,6 +29,7 @@ class Profile;
// person by pre-configuring and then locking a managed User profile.
// The ManagedMode class provides methods to check whether the browser is in
// managed mode, and to attempt to enter or leave managed mode.
+// Except where otherwise noted, this class should be used on the UI thread.
class ManagedMode : public chrome::BrowserListObserver,
public extensions::ManagementPolicy::Provider,
public content::NotificationObserver {
@@ -45,6 +48,9 @@ class ManagedMode : public chrome::BrowserListObserver,
static void EnterManagedMode(Profile* profile, const EnterCallback& callback);
static void LeaveManagedMode();
+ // Returns the URL filter. This method should only be called on the IO thread.
+ static const ManagedModeURLFilter* GetURLFilter();
+
// ExtensionManagementPolicy::Provider implementation:
virtual std::string GetDebugPolicyProviderName() const OVERRIDE;
virtual bool UserMayLoad(const extensions::Extension* extension,
@@ -70,8 +76,10 @@ class ManagedMode : public chrome::BrowserListObserver,
Profile* managed_profile_;
private:
+ class URLFilterContext;
+
+ friend class Singleton<ManagedMode, LeakySingletonTraits<ManagedMode> >;
friend struct DefaultSingletonTraits<ManagedMode>;
- friend class Singleton<ManagedMode>;
FRIEND_TEST_ALL_PREFIXES(ExtensionApiTest, ManagedModeOnChange);
FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
ManagedModeProhibitsModification);
@@ -87,6 +95,8 @@ class ManagedMode : public chrome::BrowserListObserver,
void LeaveManagedModeImpl();
+ const ManagedModeURLFilter* GetURLFilterImpl();
+
void FinalizeEnter(bool result);
// Platform-specific methods that confirm whether we can enter or leave
@@ -103,8 +113,12 @@ class ManagedMode : public chrome::BrowserListObserver,
// testing).
virtual void SetInManagedMode(Profile* newly_managed_profile);
+ void UpdateWhitelist();
+
content::NotificationRegistrar registrar_;
+ scoped_ptr<URLFilterContext> url_filter_context_;
+
std::set<Browser*> browsers_to_close_;
std::vector<EnterCallback> callbacks_;
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/managed_mode.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698