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_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
12 | 12 |
| 13 namespace base { |
| 14 class Value; |
| 15 } |
| 16 |
13 namespace extensions { | 17 namespace extensions { |
14 | 18 |
15 class GetChromeosInfoFunction : public AsyncExtensionFunction { | 19 class GetChromeosInfoFunction : public AsyncExtensionFunction { |
16 public: | 20 public: |
17 GetChromeosInfoFunction(); | 21 GetChromeosInfoFunction(); |
18 | 22 |
19 protected: | 23 protected: |
20 virtual ~GetChromeosInfoFunction(); | 24 virtual ~GetChromeosInfoFunction(); |
21 | 25 |
22 virtual bool RunImpl() OVERRIDE; | 26 virtual bool RunImpl() OVERRIDE; |
23 | 27 |
24 private: | 28 private: |
25 bool GetValue(const std::string& property_name, Value** value); | 29 // Returns a newly allocate value, or null. |
| 30 base::Value* GetValue(const std::string& property_name); |
26 | 31 |
27 DECLARE_EXTENSION_FUNCTION_NAME("chromeosInfoPrivate.get"); | 32 DECLARE_EXTENSION_FUNCTION_NAME("chromeosInfoPrivate.get"); |
28 }; | 33 }; |
29 | 34 |
30 } // namespace extensions | 35 } // namespace extensions |
31 | 36 |
32 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ | 37 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INFO_PRIVATE_API_H_ |
OLD | NEW |