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_util.h" | 8 #include "chrome/browser/extensions/extension_util.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/extensions/application_launch.h" | 10 #include "chrome/browser/ui/extensions/application_launch.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 | 150 |
151 bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const { | 151 bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const { |
152 return false; | 152 return false; |
153 } | 153 } |
154 | 154 |
155 WebContents* EphemeralAppLauncher::GetWebContents() const { | 155 WebContents* EphemeralAppLauncher::GetWebContents() const { |
156 return web_contents() ? web_contents() : dummy_web_contents_.get(); | 156 return web_contents() ? web_contents() : dummy_web_contents_.get(); |
157 } | 157 } |
158 | 158 |
159 scoped_ptr<ExtensionInstallPrompt::Prompt> | 159 scoped_refptr<ExtensionInstallPrompt::Prompt> |
160 EphemeralAppLauncher::CreateInstallPrompt() const { | 160 EphemeralAppLauncher::CreateInstallPrompt() const { |
161 DCHECK(extension_.get() != NULL); | 161 DCHECK(extension_.get() != NULL); |
162 | 162 |
163 // Skip the prompt by returning null if the app does not need to display | 163 // Skip the prompt by returning null if the app does not need to display |
164 // permission warnings. | 164 // permission warnings. |
165 extensions::PermissionMessages permissions = | 165 extensions::PermissionMessages permissions = |
166 extension_->permissions_data()->GetPermissionMessages(); | 166 extension_->permissions_data()->GetPermissionMessages(); |
167 if (permissions.empty()) | 167 if (permissions.empty()) |
168 return scoped_ptr<ExtensionInstallPrompt::Prompt>(); | 168 return NULL; |
169 | 169 |
170 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( | 170 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt( |
171 ExtensionInstallPrompt::LAUNCH_PROMPT)); | 171 ExtensionInstallPrompt::LAUNCH_PROMPT)); |
172 } | 172 } |
173 | 173 |
174 bool EphemeralAppLauncher::CheckInlineInstallPermitted( | 174 bool EphemeralAppLauncher::CheckInlineInstallPermitted( |
175 const base::DictionaryValue& webstore_data, | 175 const base::DictionaryValue& webstore_data, |
176 std::string* error) const { | 176 std::string* error) const { |
177 *error = ""; | 177 *error = ""; |
178 return true; | 178 return true; |
179 } | 179 } |
180 | 180 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 AbortInstall(); | 241 AbortInstall(); |
242 } | 242 } |
243 | 243 |
244 void EphemeralAppLauncher::ExtensionEnableFlowFinished() { | 244 void EphemeralAppLauncher::ExtensionEnableFlowFinished() { |
245 CompleteInstall(std::string()); | 245 CompleteInstall(std::string()); |
246 } | 246 } |
247 | 247 |
248 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 248 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
249 CompleteInstall(kLaunchAbortedError); | 249 CompleteInstall(kLaunchAbortedError); |
250 } | 250 } |
OLD | NEW |