| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | |
| 6 #define CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | |
| 7 | |
| 8 #include "build/build_config.h" | |
| 9 | |
| 10 #if defined(ENABLE_RLZ) | |
| 11 | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "chrome/browser/extensions/extension_function.h" | |
| 14 #include "rlz/lib/lib_values.h" | |
| 15 | |
| 16 class RlzRecordProductEventFunction : public SyncExtensionFunction { | |
| 17 public: | |
| 18 DECLARE_EXTENSION_FUNCTION("experimental.rlz.recordProductEvent", | |
| 19 EXPERIMENTAL_RLZ_RECORDPRODUCTEVENT) | |
| 20 | |
| 21 protected: | |
| 22 virtual ~RlzRecordProductEventFunction() {} | |
| 23 | |
| 24 // ExtensionFunction: | |
| 25 virtual bool RunImpl() OVERRIDE; | |
| 26 }; | |
| 27 | |
| 28 class RlzGetAccessPointRlzFunction : public SyncExtensionFunction { | |
| 29 public: | |
| 30 DECLARE_EXTENSION_FUNCTION("experimental.rlz.getAccessPointRlz", | |
| 31 EXPERIMENTAL_RLZ_GETACCESSPOINTRLZ) | |
| 32 | |
| 33 protected: | |
| 34 virtual ~RlzGetAccessPointRlzFunction() {} | |
| 35 | |
| 36 // ExtensionFunction: | |
| 37 virtual bool RunImpl() OVERRIDE; | |
| 38 }; | |
| 39 | |
| 40 class RlzSendFinancialPingFunction : public AsyncExtensionFunction { | |
| 41 public: | |
| 42 DECLARE_EXTENSION_FUNCTION("experimental.rlz.sendFinancialPing", | |
| 43 EXPERIMENTAL_RLZ_SENDFINANCIALPING) | |
| 44 | |
| 45 RlzSendFinancialPingFunction(); | |
| 46 | |
| 47 protected: | |
| 48 friend class MockRlzSendFinancialPingFunction; | |
| 49 virtual ~RlzSendFinancialPingFunction(); | |
| 50 | |
| 51 // ExtensionFunction: | |
| 52 virtual bool RunImpl() OVERRIDE; | |
| 53 | |
| 54 private: | |
| 55 void WorkOnWorkerThread(); | |
| 56 void RespondOnUIThread(); | |
| 57 | |
| 58 rlz_lib::Product product_; | |
| 59 scoped_ptr<rlz_lib::AccessPoint[]> access_points_; | |
| 60 std::string signature_; | |
| 61 std::string brand_; | |
| 62 std::string id_; | |
| 63 std::string lang_; | |
| 64 bool exclude_machine_id_; | |
| 65 }; | |
| 66 | |
| 67 class RlzClearProductStateFunction : public SyncExtensionFunction { | |
| 68 public: | |
| 69 DECLARE_EXTENSION_FUNCTION("experimental.rlz.clearProductState", | |
| 70 EXPERIMENTAL_RLZ_CLEARPRODUCTSTATE) | |
| 71 | |
| 72 protected: | |
| 73 virtual ~RlzClearProductStateFunction() {} | |
| 74 | |
| 75 // ExtensionFunction: | |
| 76 virtual bool RunImpl() OVERRIDE; | |
| 77 }; | |
| 78 | |
| 79 #endif // defined(ENABLE_RLZ) | |
| 80 | |
| 81 #endif // CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_ | |
| OLD | NEW |