| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "chrome/browser/extensions/webstore_standalone_installer.h" | 11 #include "chrome/browser/extensions/webstore_standalone_installer.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } // namespace content | 15 } // namespace content |
| 16 | 16 |
| 17 namespace file_manager { | 17 namespace file_manager { |
| 18 | 18 |
| 19 // This class is used for installing apps and extensions suggested from the | 19 // This class is used for installing apps and extensions suggested from the |
| 20 // Chrome Web Store for unsupported file types, inside Files.app. | 20 // Chrome Web Store for unsupported file types, inside Files.app. |
| 21 class AppInstaller : public extensions::WebstoreStandaloneInstaller { | 21 class AppInstaller : public extensions::WebstoreStandaloneInstaller { |
| 22 public: | 22 public: |
| 23 AppInstaller(content::WebContents* web_contents, | 23 AppInstaller(content::WebContents* web_contents, |
| 24 const std::string& item_id, | 24 const std::string& item_id, |
| 25 Profile* profile, | 25 Profile* profile, |
| 26 bool silent_installation, |
| 26 const Callback& callback); | 27 const Callback& callback); |
| 27 | 28 |
| 28 protected: | 29 protected: |
| 29 friend class base::RefCountedThreadSafe<AppInstaller>; | 30 friend class base::RefCountedThreadSafe<AppInstaller>; |
| 30 | 31 |
| 31 virtual ~AppInstaller(); | 32 virtual ~AppInstaller(); |
| 32 | 33 |
| 33 void OnWebContentsDestroyed(content::WebContents* web_contents); | 34 void OnWebContentsDestroyed(content::WebContents* web_contents); |
| 34 | 35 |
| 35 // WebstoreStandaloneInstaller implementation. | 36 // WebstoreStandaloneInstaller implementation. |
| 36 virtual bool CheckRequestorAlive() const OVERRIDE; | 37 virtual bool CheckRequestorAlive() const OVERRIDE; |
| 37 virtual const GURL& GetRequestorURL() const OVERRIDE; | 38 virtual const GURL& GetRequestorURL() const OVERRIDE; |
| 38 virtual bool ShouldShowPostInstallUI() const OVERRIDE; | 39 virtual bool ShouldShowPostInstallUI() const OVERRIDE; |
| 39 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE; | 40 virtual bool ShouldShowAppInstalledBubble() const OVERRIDE; |
| 40 virtual content::WebContents* GetWebContents() const OVERRIDE; | 41 virtual content::WebContents* GetWebContents() const OVERRIDE; |
| 41 virtual scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() | 42 virtual scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt() |
| 42 const OVERRIDE; | 43 const OVERRIDE; |
| 43 virtual bool CheckInlineInstallPermitted( | 44 virtual bool CheckInlineInstallPermitted( |
| 44 const base::DictionaryValue& webstore_data, | 45 const base::DictionaryValue& webstore_data, |
| 45 std::string* error) const OVERRIDE; | 46 std::string* error) const OVERRIDE; |
| 46 virtual bool CheckRequestorPermitted( | 47 virtual bool CheckRequestorPermitted( |
| 47 const base::DictionaryValue& webstore_data, | 48 const base::DictionaryValue& webstore_data, |
| 48 std::string* error) const OVERRIDE; | 49 std::string* error) const OVERRIDE; |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 class WebContentsObserver; | 52 class WebContentsObserver; |
| 52 | 53 |
| 54 bool silent_installation_; |
| 53 Callback callback_; | 55 Callback callback_; |
| 54 content::WebContents* web_contents_; | 56 content::WebContents* web_contents_; |
| 55 scoped_ptr<WebContentsObserver> web_contents_observer_; | 57 scoped_ptr<WebContentsObserver> web_contents_observer_; |
| 56 | 58 |
| 57 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller); | 59 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace file_manager | 62 } // namespace file_manager |
| 61 | 63 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ |
| OLD | NEW |