Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher.cc

Issue 313203004: Make ExtensionInstallPrompt::Prompt ref-counted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const { 163 bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const {
164 return false; 164 return false;
165 } 165 }
166 166
167 WebContents* EphemeralAppLauncher::GetWebContents() const { 167 WebContents* EphemeralAppLauncher::GetWebContents() const {
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_refptr<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 extension_->permissions_data()->GetPermissionMessages(); 178 extension_->permissions_data()->GetPermissionMessages();
179 if (permissions.empty()) 179 if (permissions.empty())
180 return scoped_ptr<ExtensionInstallPrompt::Prompt>(); 180 return NULL;
181 181
182 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( 182 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt(
183 ExtensionInstallPrompt::LAUNCH_PROMPT)); 183 ExtensionInstallPrompt::LAUNCH_PROMPT));
184 } 184 }
185 185
186 bool EphemeralAppLauncher::CheckInlineInstallPermitted( 186 bool EphemeralAppLauncher::CheckInlineInstallPermitted(
187 const base::DictionaryValue& webstore_data, 187 const base::DictionaryValue& webstore_data,
188 std::string* error) const { 188 std::string* error) const {
189 *error = ""; 189 *error = "";
190 return true; 190 return true;
191 } 191 }
192 192
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 LaunchApp(extension); 274 LaunchApp(extension);
275 WebstoreStandaloneInstaller::CompleteInstall(std::string()); 275 WebstoreStandaloneInstaller::CompleteInstall(std::string());
276 } else { 276 } else {
277 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 277 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
278 } 278 }
279 } 279 }
280 280
281 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { 281 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
282 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 282 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
283 } 283 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698