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 "chrome/browser/extensions/extension_install_prompt.h" | 7 #include "chrome/browser/extensions/extension_install_prompt.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return web_contents() ? web_contents() : dummy_web_contents_.get(); | 168 return web_contents() ? web_contents() : dummy_web_contents_.get(); |
169 } | 169 } |
170 | 170 |
171 scoped_ptr<ExtensionInstallPrompt::Prompt> | 171 scoped_ptr<ExtensionInstallPrompt::Prompt> |
172 EphemeralAppLauncher::CreateInstallPrompt() const { | 172 EphemeralAppLauncher::CreateInstallPrompt() const { |
173 DCHECK(extension_.get() != NULL); | 173 DCHECK(extension_.get() != NULL); |
174 | 174 |
175 // Skip the prompt by returning null if the app does not need to display | 175 // Skip the prompt by returning null if the app does not need to display |
176 // permission warnings. | 176 // permission warnings. |
177 extensions::PermissionMessages permissions = | 177 extensions::PermissionMessages permissions = |
178 extensions::PermissionsData::ForExtension(extension_) | 178 extension_->permissions_data()->GetPermissionMessages(); |
179 ->GetPermissionMessages(); | |
180 if (permissions.empty()) | 179 if (permissions.empty()) |
181 return scoped_ptr<ExtensionInstallPrompt::Prompt>(); | 180 return scoped_ptr<ExtensionInstallPrompt::Prompt>(); |
182 | 181 |
183 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( | 182 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( |
184 ExtensionInstallPrompt::LAUNCH_PROMPT)); | 183 ExtensionInstallPrompt::LAUNCH_PROMPT)); |
185 } | 184 } |
186 | 185 |
187 bool EphemeralAppLauncher::CheckInlineInstallPermitted( | 186 bool EphemeralAppLauncher::CheckInlineInstallPermitted( |
188 const base::DictionaryValue& webstore_data, | 187 const base::DictionaryValue& webstore_data, |
189 std::string* error) const { | 188 std::string* error) const { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 LaunchApp(extension); | 274 LaunchApp(extension); |
276 WebstoreStandaloneInstaller::CompleteInstall(std::string()); | 275 WebstoreStandaloneInstaller::CompleteInstall(std::string()); |
277 } else { | 276 } else { |
278 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); | 277 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); |
279 } | 278 } |
280 } | 279 } |
281 | 280 |
282 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 281 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
283 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); | 282 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); |
284 } | 283 } |
OLD | NEW |