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

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

Issue 507483003: Remove implicit conversions from scoped_refptr to T* in chrome/browser/apps/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 "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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 WebstoreStandaloneInstaller::CompleteInstall(result, error); 312 WebstoreStandaloneInstaller::CompleteInstall(result, error);
313 } 313 }
314 314
315 void EphemeralAppLauncher::CheckEphemeralInstallPermitted() { 315 void EphemeralAppLauncher::CheckEphemeralInstallPermitted() {
316 scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay(); 316 scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay();
317 DCHECK(extension.get()); // Checked in OnManifestParsed(). 317 DCHECK(extension.get()); // Checked in OnManifestParsed().
318 318
319 install_checker_ = CreateInstallChecker(); 319 install_checker_ = CreateInstallChecker();
320 DCHECK(install_checker_.get()); 320 DCHECK(install_checker_.get());
321 321
322 install_checker_->set_extension(extension); 322 install_checker_->set_extension(extension.get());
323 install_checker_->Start(ExtensionInstallChecker::CHECK_BLACKLIST | 323 install_checker_->Start(ExtensionInstallChecker::CHECK_BLACKLIST |
324 ExtensionInstallChecker::CHECK_REQUIREMENTS, 324 ExtensionInstallChecker::CHECK_REQUIREMENTS,
325 true, 325 true,
326 base::Bind(&EphemeralAppLauncher::OnInstallChecked, 326 base::Bind(&EphemeralAppLauncher::OnInstallChecked,
327 base::Unretained(this))); 327 base::Unretained(this)));
328 } 328 }
329 329
330 void EphemeralAppLauncher::OnInstallChecked(int check_failures) { 330 void EphemeralAppLauncher::OnInstallChecked(int check_failures) {
331 if (!CheckRequestorAlive()) { 331 if (!CheckRequestorAlive()) {
332 AbortLaunch(webstore_install::OTHER_ERROR, std::string()); 332 AbortLaunch(webstore_install::OTHER_ERROR, std::string());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 398
399 bool EphemeralAppLauncher::CheckRequestorPermitted( 399 bool EphemeralAppLauncher::CheckRequestorPermitted(
400 const base::DictionaryValue& webstore_data, 400 const base::DictionaryValue& webstore_data,
401 std::string* error) const { 401 std::string* error) const {
402 *error = ""; 402 *error = "";
403 return true; 403 return true;
404 } 404 }
405 405
406 void EphemeralAppLauncher::OnManifestParsed() { 406 void EphemeralAppLauncher::OnManifestParsed() {
407 const Extension* extension = GetLocalizedExtensionForDisplay(); 407 const scoped_refptr<Extension> extension = GetLocalizedExtensionForDisplay();
dcheng 2014/08/26 00:18:25 Note: this variable type was rewritten instead of
benwells 2014/08/26 05:22:22 From looking at the impl, it looks like this is ri
408 if (!extension) { 408 if (!extension) {
benwells 2014/08/26 05:22:21 Does this function need changes so it isn't doing
dcheng 2014/08/26 05:28:06 Yeah, I was fixing it locally since I just noticed
409 AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError); 409 AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError);
410 return; 410 return;
411 } 411 }
412 412
413 webstore_install::Result result = webstore_install::OTHER_ERROR; 413 webstore_install::Result result = webstore_install::OTHER_ERROR;
414 std::string error; 414 std::string error;
415 if (!CheckCommonLaunchCriteria(profile(), extension, &result, &error)) { 415 if (!CheckCommonLaunchCriteria(profile(), extension, &result, &error)) {
416 AbortLaunch(result, error); 416 AbortLaunch(result, error);
417 return; 417 return;
418 } 418 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 456
457 // CompleteInstall will call Release. 457 // CompleteInstall will call Release.
458 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, 458 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS,
459 std::string()); 459 std::string());
460 } 460 }
461 461
462 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { 462 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
463 // CompleteInstall will call Release. 463 // CompleteInstall will call Release.
464 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); 464 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError);
465 } 465 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/drive/drive_app_provider_browsertest.cc ('k') | chrome/browser/apps/ephemeral_app_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698