Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / app_installer.h
blob833df68dea508444fc715ea5a200d80ea0e52500
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_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/extensions/webstore_standalone_installer.h"
13 namespace content {
14 class WebContents;
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 {
22 public:
23 AppInstaller(content::WebContents* web_contents,
24 const std::string& item_id,
25 Profile* profile,
26 bool silent_installation,
27 const Callback& callback);
29 protected:
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()
43 const override;
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;
49 private:
50 class WebContentsObserver;
52 bool silent_installation_;
53 Callback callback_;
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_