1 // Copyright 2013 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_EXTENSIONS_WEBSTORE_EPHEMERAL_INSTALLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_EPHEMERAL_INSTALLER_H_
10 #include "base/basictypes.h"
11 #include "chrome/browser/extensions/webstore_standalone_installer.h"
19 namespace extensions {
21 // WebstoreEphemeralInstaller handles the installation of ephemeral apps.
22 class WebstoreEphemeralInstaller
23 : public extensions::WebstoreStandaloneInstaller {
25 typedef WebstoreStandaloneInstaller::Callback Callback;
27 static scoped_refptr<WebstoreEphemeralInstaller> CreateForLauncher(
28 const std::string& webstore_item_id,
30 gfx::NativeWindow parent_window,
31 const Callback& callback);
34 friend class base::RefCountedThreadSafe<WebstoreEphemeralInstaller>;
36 WebstoreEphemeralInstaller(const std::string& webstore_item_id,
38 gfx::NativeWindow parent_window,
39 const Callback& callback);
41 virtual ~WebstoreEphemeralInstaller();
43 // WebstoreStandaloneInstaller implementation.
44 virtual bool CheckRequestorAlive() const OVERRIDE;
45 virtual const GURL& GetRequestorURL() const OVERRIDE;
46 virtual bool ShouldShowPostInstallUI() const OVERRIDE;
47 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE;
48 virtual content::WebContents* GetWebContents() const OVERRIDE;
49 virtual scoped_ptr<ExtensionInstallPrompt::Prompt>
50 CreateInstallPrompt() const OVERRIDE;
51 virtual bool CheckInlineInstallPermitted(
52 const base::DictionaryValue& webstore_data,
53 std::string* error) const OVERRIDE;
54 virtual bool CheckRequestorPermitted(
55 const base::DictionaryValue& webstore_data,
56 std::string* error) const OVERRIDE;
57 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() OVERRIDE;
59 gfx::NativeWindow parent_window_;
60 scoped_ptr<content::WebContents> dummy_web_contents_;
62 DISALLOW_COPY_AND_ASSIGN(WebstoreEphemeralInstaller);
65 } // namespace extensions
67 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_EPHEMERAL_INSTALLER_H_