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_FILE_MANAGER_INSTALLER_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_MANAGER_INSTALLER_H_
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/extensions/webstore_standalone_installer.h"
12 #include "content/public/browser/web_contents_observer.h"
18 namespace file_manager {
20 // Installer for Files.app.
21 class FileManagerInstaller
22 : public extensions::WebstoreStandaloneInstaller {
24 typedef extensions::WebstoreStandaloneInstaller::Callback Callback;
26 FileManagerInstaller(content::WebContents* web_contents,
27 const std::string& webstore_item_id,
29 const Callback& callback);
32 friend class base::RefCountedThreadSafe<FileManagerInstaller>;
34 virtual ~FileManagerInstaller();
36 void OnWebContentsDestroyed(content::WebContents* web_contents);
38 // WebstoreStandaloneInstaller implementation.
39 virtual bool CheckRequestorAlive() const OVERRIDE;
40 virtual const GURL& GetRequestorURL() const OVERRIDE;
41 virtual bool ShouldShowPostInstallUI() const OVERRIDE;
42 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE;
43 virtual content::WebContents* GetWebContents() const OVERRIDE;
44 virtual scoped_ptr<ExtensionInstallPrompt::Prompt>
45 CreateInstallPrompt() const OVERRIDE;
46 virtual bool CheckInlineInstallPermitted(
47 const base::DictionaryValue& webstore_data,
48 std::string* error) const OVERRIDE;
49 virtual bool CheckRequestorPermitted(
50 const base::DictionaryValue& webstore_data,
51 std::string* error) const OVERRIDE;
54 class WebContentsObserver;
57 content::WebContents* web_contents_;
58 scoped_ptr<WebContentsObserver> web_contents_observer_;
60 DISALLOW_IMPLICIT_CONSTRUCTORS(FileManagerInstaller);
63 } // namespace file_manager
65 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_MANAGER_INSTALLER_H_