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 #include "chrome/browser/apps/ephemeral_app_launcher.h" | 5 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_install_checker.h" | 9 #include "chrome/browser/extensions/extension_install_checker.h" |
10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return false; | 86 return false; |
87 } | 87 } |
88 | 88 |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 // static | 94 // static |
95 bool EphemeralAppLauncher::IsFeatureEnabled() { | 95 bool EphemeralAppLauncher::IsFeatureEnabled() { |
96 return app_list::switches::IsExperimentalAppListEnabled(); | 96 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
97 } | |
98 | |
99 // static | |
100 bool EphemeralAppLauncher::IsFeatureEnabledInWebstore() { | |
101 return IsFeatureEnabled() && | |
102 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
103 switches::kEnableEphemeralAppsInWebstore); | 97 switches::kEnableEphemeralAppsInWebstore); |
104 } | 98 } |
105 | 99 |
106 // static | 100 // static |
107 scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForLauncher( | 101 scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForLauncher( |
108 const std::string& webstore_item_id, | 102 const std::string& webstore_item_id, |
109 Profile* profile, | 103 Profile* profile, |
110 gfx::NativeWindow parent_window, | 104 gfx::NativeWindow parent_window, |
111 const LaunchCallback& callback) { | 105 const LaunchCallback& callback) { |
112 scoped_refptr<EphemeralAppLauncher> installer = | 106 scoped_refptr<EphemeralAppLauncher> installer = |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 469 |
476 // CompleteInstall will call Release. | 470 // CompleteInstall will call Release. |
477 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, | 471 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, |
478 std::string()); | 472 std::string()); |
479 } | 473 } |
480 | 474 |
481 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 475 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
482 // CompleteInstall will call Release. | 476 // CompleteInstall will call Release. |
483 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); | 477 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); |
484 } | 478 } |
OLD | NEW |