| OLD | NEW | 
|   1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |   1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 // Defines the Chrome Extensions Managed Mode API relevant classes to realize |   5 // Defines the Chrome Extensions Managed Mode API relevant classes to realize | 
|   6 // the API as specified in the extension API JSON. |   6 // the API as specified in the extension API JSON. | 
|   7  |   7  | 
|   8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ |   8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ | 
|   9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ |   9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ | 
|  10  |  10  | 
|  11 #include "base/prefs/public/pref_change_registrar.h" |  11 #include "base/prefs/public/pref_change_registrar.h" | 
|  12 #include "base/prefs/public/pref_observer.h" |  | 
|  13 #include "chrome/browser/extensions/extension_function.h" |  12 #include "chrome/browser/extensions/extension_function.h" | 
|  14 #include "content/public/browser/notification_observer.h" |  13 #include "content/public/browser/notification_observer.h" | 
|  15  |  14  | 
|  16 class Profile; |  15 class Profile; | 
|  17  |  16  | 
|  18 namespace extensions { |  17 namespace extensions { | 
|  19  |  18  | 
|  20 class ExtensionManagedModeEventRouter : public PrefObserver { |  19 class ExtensionManagedModeEventRouter { | 
|  21  public: |  20  public: | 
|  22   explicit ExtensionManagedModeEventRouter(Profile* profile); |  21   explicit ExtensionManagedModeEventRouter(Profile* profile); | 
|  23   virtual ~ExtensionManagedModeEventRouter(); |  22   virtual ~ExtensionManagedModeEventRouter(); | 
|  24  |  23  | 
|  25   // PrefObserver implementation: |  24  private: | 
|  26   virtual void OnPreferenceChanged(PrefServiceBase* service, |  25   void OnInManagedModeChanged(); | 
|  27                                    const std::string& pref_name) OVERRIDE; |  | 
|  28  |  26  | 
|  29  private: |  | 
|  30   PrefChangeRegistrar registrar_; |  27   PrefChangeRegistrar registrar_; | 
|  31   Profile* profile_; |  28   Profile* profile_; | 
|  32  |  29  | 
|  33   DISALLOW_COPY_AND_ASSIGN(ExtensionManagedModeEventRouter); |  30   DISALLOW_COPY_AND_ASSIGN(ExtensionManagedModeEventRouter); | 
|  34 }; |  31 }; | 
|  35  |  32  | 
|  36 class GetManagedModeFunction : public SyncExtensionFunction { |  33 class GetManagedModeFunction : public SyncExtensionFunction { | 
|  37  public: |  34  public: | 
|  38   DECLARE_EXTENSION_FUNCTION_NAME("managedModePrivate.get") |  35   DECLARE_EXTENSION_FUNCTION_NAME("managedModePrivate.get") | 
|  39  |  36  | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  78  protected: |  75  protected: | 
|  79   virtual ~SetPolicyFunction(); |  76   virtual ~SetPolicyFunction(); | 
|  80  |  77  | 
|  81   // ExtensionFunction: |  78   // ExtensionFunction: | 
|  82   virtual bool RunImpl() OVERRIDE; |  79   virtual bool RunImpl() OVERRIDE; | 
|  83 }; |  80 }; | 
|  84  |  81  | 
|  85 }  // namespace extensions |  82 }  // namespace extensions | 
|  86  |  83  | 
|  87 #endif  // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ |  84 #endif  // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ | 
| OLD | NEW |