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 #include "content/public/browser/web_contents_observer.h" | |
13 | 12 |
14 namespace content { | 13 namespace content { |
15 class WebContents; | 14 class WebContents; |
16 } // namespace content | 15 } // namespace content |
17 | 16 |
18 namespace file_manager { | 17 namespace file_manager { |
19 | 18 |
20 // 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 |
21 // Chrome Web Store for unsupported file types, inside Files.app. | 20 // Chrome Web Store for unsupported file types, inside Files.app. |
22 class AppInstaller | 21 class AppInstaller : public extensions::WebstoreStandaloneInstaller { |
23 : public extensions::WebstoreStandaloneInstaller { | |
24 public: | 22 public: |
25 typedef extensions::WebstoreStandaloneInstaller::Callback Callback; | |
26 | |
27 AppInstaller(content::WebContents* web_contents, | 23 AppInstaller(content::WebContents* web_contents, |
28 const std::string& webstore_item_id, | 24 const std::string& item_id, |
29 Profile* profile, | 25 Profile* profile, |
30 const Callback& callback); | 26 const Callback& callback); |
31 | 27 |
32 protected: | 28 protected: |
33 friend class base::RefCountedThreadSafe<AppInstaller>; | 29 friend class base::RefCountedThreadSafe<AppInstaller>; |
34 | 30 |
35 virtual ~AppInstaller(); | 31 virtual ~AppInstaller(); |
36 | 32 |
37 void OnWebContentsDestroyed(content::WebContents* web_contents); | 33 void OnWebContentsDestroyed(content::WebContents* web_contents); |
38 | 34 |
(...skipping 18 matching lines...) Expand all Loading... |
57 Callback callback_; | 53 Callback callback_; |
58 content::WebContents* web_contents_; | 54 content::WebContents* web_contents_; |
59 scoped_ptr<WebContentsObserver> web_contents_observer_; | 55 scoped_ptr<WebContentsObserver> web_contents_observer_; |
60 | 56 |
61 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller); | 57 DISALLOW_IMPLICIT_CONSTRUCTORS(AppInstaller); |
62 }; | 58 }; |
63 | 59 |
64 } // namespace file_manager | 60 } // namespace file_manager |
65 | 61 |
66 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ | 62 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_APP_INSTALLER_H_ |
OLD | NEW |