OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_webstore_private_api.h" | 5 #include "chrome/browser/extensions/extension_webstore_private_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 396 |
397 // Matches the AddRef in RunImpl(). | 397 // Matches the AddRef in RunImpl(). |
398 Release(); | 398 Release(); |
399 } | 399 } |
400 | 400 |
401 void BeginInstallWithManifestFunction::InstallUIProceed() { | 401 void BeginInstallWithManifestFunction::InstallUIProceed() { |
402 // This gets cleared in CrxInstaller::ConfirmInstall(). TODO(asargent) - in | 402 // This gets cleared in CrxInstaller::ConfirmInstall(). TODO(asargent) - in |
403 // the future we may also want to add time-based expiration, where a whitelist | 403 // the future we may also want to add time-based expiration, where a whitelist |
404 // entry is only valid for some number of minutes. | 404 // entry is only valid for some number of minutes. |
405 scoped_ptr<WebstoreInstaller::Approval> approval( | 405 scoped_ptr<WebstoreInstaller::Approval> approval( |
406 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( | 406 new WebstoreInstaller::Approval); |
407 profile(), id_, parsed_manifest_.Pass())); | 407 approval->extension_id = id_; |
| 408 approval->profile = profile(); |
| 409 approval->parsed_manifest.reset(parsed_manifest_.release()); |
408 approval->use_app_installed_bubble = use_app_installed_bubble_; | 410 approval->use_app_installed_bubble = use_app_installed_bubble_; |
409 g_pending_approvals.Get().PushApproval(approval.Pass()); | 411 g_pending_approvals.Get().PushApproval(approval.Pass()); |
410 | 412 |
411 SetResult(ERROR_NONE); | 413 SetResult(ERROR_NONE); |
412 SendResponse(true); | 414 SendResponse(true); |
413 | 415 |
414 // The Permissions_Install histogram is recorded from the ExtensionService | 416 // The Permissions_Install histogram is recorded from the ExtensionService |
415 // for all extension installs, so we only need to record the web store | 417 // for all extension installs, so we only need to record the web store |
416 // specific histogram here. | 418 // specific histogram here. |
417 ExtensionService::RecordPermissionMessagesHistogram( | 419 ExtensionService::RecordPermissionMessagesHistogram( |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 void SilentlyInstallFunction::OnWebstoreParseSuccess( | 503 void SilentlyInstallFunction::OnWebstoreParseSuccess( |
502 const std::string& id, | 504 const std::string& id, |
503 const SkBitmap& icon, | 505 const SkBitmap& icon, |
504 base::DictionaryValue* parsed_manifest) { | 506 base::DictionaryValue* parsed_manifest) { |
505 CHECK_EQ(id_, id); | 507 CHECK_EQ(id_, id); |
506 | 508 |
507 // This lets CrxInstaller bypass the permission confirmation UI for the | 509 // This lets CrxInstaller bypass the permission confirmation UI for the |
508 // extension. The whitelist entry gets cleared in | 510 // extension. The whitelist entry gets cleared in |
509 // CrxInstaller::ConfirmInstall. | 511 // CrxInstaller::ConfirmInstall. |
510 scoped_ptr<WebstoreInstaller::Approval> approval( | 512 scoped_ptr<WebstoreInstaller::Approval> approval( |
511 WebstoreInstaller::Approval::CreateWithNoInstallPrompt( | 513 new WebstoreInstaller::Approval); |
512 profile(), id_, scoped_ptr<base::DictionaryValue>(parsed_manifest))); | 514 approval->extension_id = id_; |
| 515 approval->parsed_manifest.reset(parsed_manifest); |
| 516 approval->profile = profile(); |
| 517 approval->use_app_installed_bubble = false; |
513 approval->skip_post_install_ui = true; | 518 approval->skip_post_install_ui = true; |
514 | 519 |
515 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( | 520 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( |
516 profile(), this, | 521 profile(), this, |
517 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), | 522 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), |
518 id_, approval.Pass(), WebstoreInstaller::FLAG_NONE); | 523 id_, approval.Pass(), WebstoreInstaller::FLAG_NONE); |
519 installer->Start(); | 524 installer->Start(); |
520 } | 525 } |
521 | 526 |
522 void SilentlyInstallFunction::OnWebstoreParseFailure( | 527 void SilentlyInstallFunction::OnWebstoreParseFailure( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 SendResponse(true); | 634 SendResponse(true); |
630 } else { | 635 } else { |
631 // Matched with a Release in OnGpuInfoUpdate. | 636 // Matched with a Release in OnGpuInfoUpdate. |
632 AddRef(); | 637 AddRef(); |
633 | 638 |
634 manager->AddObserver(this); | 639 manager->AddObserver(this); |
635 manager->RequestCompleteGpuInfoIfNeeded(); | 640 manager->RequestCompleteGpuInfoIfNeeded(); |
636 } | 641 } |
637 return true; | 642 return true; |
638 } | 643 } |
OLD | NEW |