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_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/extensions/webstore_standalone_installer.h"
15 } // namespace content
17 namespace file_manager
{
19 // This class is used for installing apps and extensions suggested from the
20 // Chrome Web Store for unsupported file types, inside Files.app.
21 class AppInstaller
: public extensions::WebstoreStandaloneInstaller
{
23 AppInstaller(content::WebContents
* web_contents
,
24 const std::string
& item_id
,
26 bool silent_installation
,
27 const Callback
& callback
);
30 friend class base::RefCountedThreadSafe
<AppInstaller
>;
32 ~AppInstaller() override
;
34 void OnWebContentsDestroyed(content::WebContents
* web_contents
);
36 // WebstoreStandaloneInstaller implementation.
37 bool CheckRequestorAlive() const override
;
38 const GURL
& GetRequestorURL() const override
;
39 bool ShouldShowPostInstallUI() const override
;
40 bool ShouldShowAppInstalledBubble() const override
;
41 content::WebContents
* GetWebContents() const override
;
42 scoped_refptr
<ExtensionInstallPrompt::Prompt
> CreateInstallPrompt()
44 bool CheckInlineInstallPermitted(const base::DictionaryValue
& webstore_data
,
45 std::string
* error
) const override
;
46 bool CheckRequestorPermitted(const base::DictionaryValue
& webstore_data
,
47 std::string
* error
) const override
;
50 class WebContentsObserver
;
52 bool silent_installation_
;
54 content::WebContents
* web_contents_
;
55 scoped_ptr
<WebContentsObserver
> web_contents_observer_
;
57 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller
);
60 } // namespace file_manager
62 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_