extension_webstore_private_api.h revision 731df977c0511bca2206b5f333555b1205ff1f43
1// Copyright (c) 2010 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_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_
6#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_
7#pragma once
8
9#include "chrome/browser/extensions/extension_function.h"
10#include "chrome/browser/sync/profile_sync_service_observer.h"
11
12class ProfileSyncService;
13
14class WebstorePrivateApi {
15 public:
16  // Allows you to set the ProfileSyncService the function will use for
17  // testing purposes.
18  static void SetTestingProfileSyncService(ProfileSyncService* service);
19};
20
21class InstallFunction : public SyncExtensionFunction {
22 public:
23  static void SetTestingInstallBaseUrl(const char* testing_install_base_url);
24
25 protected:
26  ~InstallFunction() {}
27  virtual bool RunImpl();
28  DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.install");
29};
30
31class GetBrowserLoginFunction : public SyncExtensionFunction {
32  virtual bool RunImpl();
33  DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getBrowserLogin");
34};
35
36class GetStoreLoginFunction : public SyncExtensionFunction {
37  virtual bool RunImpl();
38  DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.getStoreLogin");
39};
40
41class SetStoreLoginFunction : public SyncExtensionFunction {
42  virtual bool RunImpl();
43  DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.setStoreLogin");
44};
45
46class PromptBrowserLoginFunction : public AsyncExtensionFunction,
47                                   public ProfileSyncServiceObserver {
48 public:
49  // Implements ProfileSyncServiceObserver interface.
50  virtual void OnStateChanged();
51
52 protected:
53  virtual ~PromptBrowserLoginFunction();
54  virtual bool RunImpl();
55
56  DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.promptBrowserLogin");
57};
58
59#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_
60