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 #ifndef CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | 5 #ifndef CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ |
6 #define CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | 6 #define CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) || defined(OS_MACOSX) |
12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/extensions/extension_function.h" | 14 #include "chrome/browser/extensions/extension_function.h" |
| 15 #include "rlz/lib/lib_values.h" |
14 | 16 |
15 class RlzRecordProductEventFunction : public SyncExtensionFunction { | 17 class RlzRecordProductEventFunction : public SyncExtensionFunction { |
16 virtual bool RunImpl() OVERRIDE; | 18 virtual bool RunImpl() OVERRIDE; |
17 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.recordProductEvent") | 19 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.recordProductEvent") |
18 }; | 20 }; |
19 | 21 |
20 class RlzGetAccessPointRlzFunction : public SyncExtensionFunction { | 22 class RlzGetAccessPointRlzFunction : public SyncExtensionFunction { |
21 virtual bool RunImpl() OVERRIDE; | 23 virtual bool RunImpl() OVERRIDE; |
22 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.getAccessPointRlz") | 24 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.getAccessPointRlz") |
23 }; | 25 }; |
24 | 26 |
25 class RlzSendFinancialPingFunction : public SyncExtensionFunction { | 27 class RlzSendFinancialPingFunction : public AsyncExtensionFunction { |
| 28 public: |
| 29 RlzSendFinancialPingFunction(); |
| 30 virtual ~RlzSendFinancialPingFunction(); |
| 31 |
26 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.sendFinancialPing") | 32 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.sendFinancialPing") |
27 // Making this function protected so that it can be overridden in tests. | 33 // Making this function protected so that it can be overridden in tests. |
28 protected: | 34 protected: |
29 virtual bool RunImpl() OVERRIDE; | 35 virtual bool RunImpl() OVERRIDE; |
| 36 |
| 37 private: |
| 38 void WorkOnWorkerThread(); |
| 39 void RespondOnUIThread(); |
| 40 |
| 41 rlz_lib::Product product_; |
| 42 scoped_array<rlz_lib::AccessPoint> access_points_; |
| 43 std::string signature_; |
| 44 std::string brand_; |
| 45 std::string id_; |
| 46 std::string lang_; |
| 47 bool exclude_machine_id_; |
30 }; | 48 }; |
31 | 49 |
32 class RlzClearProductStateFunction : public SyncExtensionFunction { | 50 class RlzClearProductStateFunction : public SyncExtensionFunction { |
33 virtual bool RunImpl() OVERRIDE; | 51 virtual bool RunImpl() OVERRIDE; |
34 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.clearProductState") | 52 DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.clearProductState") |
35 }; | 53 }; |
36 | 54 |
37 #endif // defined(OS_WIN) | 55 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
38 | 56 |
39 #endif // CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | 57 #endif // CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ |
OLD | NEW |