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_APPS_EPHEMERAL_APP_LAUNCHER_H_ | 5 #ifndef CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_ |
6 #define CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_ | 6 #define CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // EphemeralAppLauncher manages the launching of ephemeral apps. It handles | 32 // EphemeralAppLauncher manages the launching of ephemeral apps. It handles |
33 // display of a prompt, initiates install of the app (if necessary) and finally | 33 // display of a prompt, initiates install of the app (if necessary) and finally |
34 // launches the app. | 34 // launches the app. |
35 class EphemeralAppLauncher : public extensions::WebstoreStandaloneInstaller, | 35 class EphemeralAppLauncher : public extensions::WebstoreStandaloneInstaller, |
36 public content::WebContentsObserver, | 36 public content::WebContentsObserver, |
37 public ExtensionEnableFlowDelegate { | 37 public ExtensionEnableFlowDelegate { |
38 public: | 38 public: |
39 typedef base::Callback<void(extensions::webstore_install::Result result, | 39 typedef base::Callback<void(extensions::webstore_install::Result result, |
40 const std::string& error)> LaunchCallback; | 40 const std::string& error)> LaunchCallback; |
41 | 41 |
42 // Returns true if launching ephemeral apps is enabled. | 42 // Returns true if launching ephemeral apps from the webstore is enabled. |
43 static bool IsFeatureEnabled(); | 43 static bool IsFeatureEnabled(); |
44 | 44 |
45 // Returns true if launching ephemeral apps from the wiebstore is enabled. | |
46 static bool IsFeatureEnabledInWebstore(); | |
47 | |
48 // Create for the app launcher. | 45 // Create for the app launcher. |
49 static scoped_refptr<EphemeralAppLauncher> CreateForLauncher( | 46 static scoped_refptr<EphemeralAppLauncher> CreateForLauncher( |
50 const std::string& webstore_item_id, | 47 const std::string& webstore_item_id, |
51 Profile* profile, | 48 Profile* profile, |
52 gfx::NativeWindow parent_window, | 49 gfx::NativeWindow parent_window, |
53 const LaunchCallback& callback); | 50 const LaunchCallback& callback); |
54 | 51 |
55 // Create for a web contents. | 52 // Create for a web contents. |
56 static scoped_refptr<EphemeralAppLauncher> CreateForWebContents( | 53 static scoped_refptr<EphemeralAppLauncher> CreateForWebContents( |
57 const std::string& webstore_item_id, | 54 const std::string& webstore_item_id, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 scoped_ptr<content::WebContents> dummy_web_contents_; | 148 scoped_ptr<content::WebContents> dummy_web_contents_; |
152 | 149 |
153 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; | 150 scoped_ptr<ExtensionEnableFlow> extension_enable_flow_; |
154 | 151 |
155 scoped_ptr<extensions::ExtensionInstallChecker> install_checker_; | 152 scoped_ptr<extensions::ExtensionInstallChecker> install_checker_; |
156 | 153 |
157 DISALLOW_COPY_AND_ASSIGN(EphemeralAppLauncher); | 154 DISALLOW_COPY_AND_ASSIGN(EphemeralAppLauncher); |
158 }; | 155 }; |
159 | 156 |
160 #endif // CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_ | 157 #endif // CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_ |
OLD | NEW |