| OLD | NEW |
| 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // The settings namespace the call was for. For example, SYNC if the API | 53 // The settings namespace the call was for. For example, SYNC if the API |
| 54 // call was chrome.settings.experimental.sync..., LOCAL if .local, etc. | 54 // call was chrome.settings.experimental.sync..., LOCAL if .local, etc. |
| 55 settings_namespace::Namespace settings_namespace_; | 55 settings_namespace::Namespace settings_namespace_; |
| 56 | 56 |
| 57 // Observers, cached so that it's only grabbed from the UI thread. | 57 // Observers, cached so that it's only grabbed from the UI thread. |
| 58 scoped_refptr<SettingsObserverList> observers_; | 58 scoped_refptr<SettingsObserverList> observers_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class GetSettingsFunction : public SettingsFunction { | 61 class GetSettingsFunction : public SettingsFunction { |
| 62 public: | 62 public: |
| 63 DECLARE_EXTENSION_FUNCTION_NAME("experimental.storage.get"); | 63 DECLARE_EXTENSION_FUNCTION_NAME("storage.get"); |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; | 66 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 class SetSettingsFunction : public SettingsFunction { | 69 class SetSettingsFunction : public SettingsFunction { |
| 70 public: | 70 public: |
| 71 DECLARE_EXTENSION_FUNCTION_NAME("experimental.storage.set"); | 71 DECLARE_EXTENSION_FUNCTION_NAME("storage.set"); |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; | 74 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; |
| 75 | 75 |
| 76 virtual void GetQuotaLimitHeuristics( | 76 virtual void GetQuotaLimitHeuristics( |
| 77 QuotaLimitHeuristics* heuristics) const OVERRIDE; | 77 QuotaLimitHeuristics* heuristics) const OVERRIDE; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 class RemoveSettingsFunction : public SettingsFunction { | 80 class RemoveSettingsFunction : public SettingsFunction { |
| 81 public: | 81 public: |
| 82 DECLARE_EXTENSION_FUNCTION_NAME("experimental.storage.remove"); | 82 DECLARE_EXTENSION_FUNCTION_NAME("storage.remove"); |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; | 85 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; |
| 86 | 86 |
| 87 virtual void GetQuotaLimitHeuristics( | 87 virtual void GetQuotaLimitHeuristics( |
| 88 QuotaLimitHeuristics* heuristics) const OVERRIDE; | 88 QuotaLimitHeuristics* heuristics) const OVERRIDE; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class ClearSettingsFunction : public SettingsFunction { | 91 class ClearSettingsFunction : public SettingsFunction { |
| 92 public: | 92 public: |
| 93 DECLARE_EXTENSION_FUNCTION_NAME("experimental.storage.clear"); | 93 DECLARE_EXTENSION_FUNCTION_NAME("storage.clear"); |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; | 96 virtual bool RunWithStorage(SettingsStorage* storage) OVERRIDE; |
| 97 | 97 |
| 98 virtual void GetQuotaLimitHeuristics( | 98 virtual void GetQuotaLimitHeuristics( |
| 99 QuotaLimitHeuristics* heuristics) const OVERRIDE; | 99 QuotaLimitHeuristics* heuristics) const OVERRIDE; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace extensions | 102 } // namespace extensions |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ | 104 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_API_H_ |
| OLD | NEW |