OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_INSTALLER_H
_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_INSTALLER_H
_ |
| 7 |
| 8 #include <string> |
| 9 |
| 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" |
| 13 |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 namespace file_manager { |
| 19 |
| 20 // Installer for Files.app. |
| 21 class FileManagerInstaller |
| 22 : public extensions::WebstoreStandaloneInstaller, |
| 23 public content::WebContentsObserver { |
| 24 public: |
| 25 typedef extensions::WebstoreStandaloneInstaller::Callback Callback; |
| 26 |
| 27 FileManagerInstaller(content::WebContents* web_contents, |
| 28 const std::string& webstore_item_id, |
| 29 Profile* profile, |
| 30 const Callback& callback); |
| 31 |
| 32 protected: |
| 33 friend class base::RefCountedThreadSafe<FileManagerInstaller>; |
| 34 |
| 35 virtual ~FileManagerInstaller(); |
| 36 |
| 37 // WebstoreStandaloneInstaller implementation. |
| 38 virtual bool CheckRequestorAlive() const OVERRIDE; |
| 39 virtual const GURL& GetRequestorURL() const OVERRIDE; |
| 40 virtual bool ShouldShowPostInstallUI() const OVERRIDE; |
| 41 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE; |
| 42 virtual content::WebContents* GetWebContents() const OVERRIDE; |
| 43 virtual scoped_ptr<ExtensionInstallPrompt::Prompt> |
| 44 CreateInstallPrompt() const OVERRIDE; |
| 45 virtual bool CheckInlineInstallPermitted( |
| 46 const base::DictionaryValue& webstore_data, |
| 47 std::string* error) const OVERRIDE; |
| 48 virtual bool CheckRequestorPermitted( |
| 49 const base::DictionaryValue& webstore_data, |
| 50 std::string* error) const OVERRIDE; |
| 51 |
| 52 private: |
| 53 // content::WebContentsObserver implementation. |
| 54 virtual void WebContentsDestroyed( |
| 55 content::WebContents* web_contents) OVERRIDE; |
| 56 |
| 57 // Dummy GURL object to return from GetRequestorURL() method. |
| 58 GURL dummy_url_; |
| 59 Callback callback_; |
| 60 |
| 61 DISALLOW_IMPLICIT_CONSTRUCTORS(FileManagerInstaller); |
| 62 }; |
| 63 |
| 64 } // namespace file_manager |
| 65 |
| 66 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_INSTALLE
R_H_ |
OLD | NEW |