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.
5 #ifndef CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_
6 #define CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_
8 #include "build/build_config.h"
10 #if defined(ENABLE_RLZ)
12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/extensions/extension_function.h"
14 #include "rlz/lib/lib_values.h"
16 class RlzRecordProductEventFunction
: public SyncExtensionFunction
{
18 DECLARE_EXTENSION_FUNCTION("experimental.rlz.recordProductEvent",
19 EXPERIMENTAL_RLZ_RECORDPRODUCTEVENT
)
22 virtual ~RlzRecordProductEventFunction() {}
25 virtual bool RunImpl() OVERRIDE
;
28 class RlzGetAccessPointRlzFunction
: public SyncExtensionFunction
{
30 DECLARE_EXTENSION_FUNCTION("experimental.rlz.getAccessPointRlz",
31 EXPERIMENTAL_RLZ_GETACCESSPOINTRLZ
)
34 virtual ~RlzGetAccessPointRlzFunction() {}
37 virtual bool RunImpl() OVERRIDE
;
40 class RlzSendFinancialPingFunction
: public AsyncExtensionFunction
{
42 DECLARE_EXTENSION_FUNCTION("experimental.rlz.sendFinancialPing",
43 EXPERIMENTAL_RLZ_SENDFINANCIALPING
)
45 RlzSendFinancialPingFunction();
48 friend class MockRlzSendFinancialPingFunction
;
49 virtual ~RlzSendFinancialPingFunction();
52 virtual bool RunImpl() OVERRIDE
;
55 void WorkOnWorkerThread();
56 void RespondOnUIThread();
58 rlz_lib::Product product_
;
59 scoped_ptr
<rlz_lib::AccessPoint
[]> access_points_
;
60 std::string signature_
;
64 bool exclude_machine_id_
;
67 class RlzClearProductStateFunction
: public SyncExtensionFunction
{
69 DECLARE_EXTENSION_FUNCTION("experimental.rlz.clearProductState",
70 EXPERIMENTAL_RLZ_CLEARPRODUCTSTATE
)
73 virtual ~RlzClearProductStateFunction() {}
76 virtual bool RunImpl() OVERRIDE
;
79 #endif // defined(ENABLE_RLZ)
81 #endif // CHROME_BROWSER_RLZ_RLZ_EXTENSION_API_H_