| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_SETTINGS_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Supports lightweight copying. | 28 // Supports lightweight copying. |
| 29 class Result { | 29 class Result { |
| 30 public: | 30 public: |
| 31 // Ownership of settings taken. | 31 // Ownership of settings taken. |
| 32 explicit Result(DictionaryValue* settings); | 32 explicit Result(DictionaryValue* settings); |
| 33 explicit Result(const std::string& error); | 33 explicit Result(const std::string& error); |
| 34 ~Result(); | 34 ~Result(); |
| 35 | 35 |
| 36 // The dictionary result of the computation. NULL does not imply invalid; | 36 // The dictionary result of the computation. NULL does not imply invalid; |
| 37 // HasError() should be used to test this. | 37 // HasError() should be used to test this. |
| 38 // Wwnership remains with with the Result. | 38 // Ownership remains with with the Result. |
| 39 DictionaryValue* GetSettings() const; | 39 DictionaryValue* GetSettings() const; |
| 40 | 40 |
| 41 // Whether there was an error in the computation. If so, the results of | 41 // Whether there was an error in the computation. If so, the results of |
| 42 // GetSettings and ReleaseSettings are not valid. | 42 // GetSettings and ReleaseSettings are not valid. |
| 43 bool HasError() const; | 43 bool HasError() const; |
| 44 | 44 |
| 45 // Gets the error message, if any. | 45 // Gets the error message, if any. |
| 46 const std::string& GetError() const; | 46 const std::string& GetError() const; |
| 47 | 47 |
| 48 private: | 48 private: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Removes multiple keys from the storage. | 87 // Removes multiple keys from the storage. |
| 88 // If successful, result value is NULL. | 88 // If successful, result value is NULL. |
| 89 virtual Result Remove(const std::vector<std::string>& keys) = 0; | 89 virtual Result Remove(const std::vector<std::string>& keys) = 0; |
| 90 | 90 |
| 91 // Clears the storage. | 91 // Clears the storage. |
| 92 // If successful, result value is NULL. | 92 // If successful, result value is NULL. |
| 93 virtual Result Clear() = 0; | 93 virtual Result Clear() = 0; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_H_ | 96 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_H_ |
| OLD | NEW |