| 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/api/webstore_private/webstore_private_api.h" | 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
| 6 | 6 |
| 7 #include "apps/app_launcher.h" | 7 #include "apps/app_launcher.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 scoped_ptr<WebstoreInstaller::Approval> PendingApprovals::PopApproval( | 79 scoped_ptr<WebstoreInstaller::Approval> PendingApprovals::PopApproval( |
| 80 Profile* profile, const std::string& id) { | 80 Profile* profile, const std::string& id) { |
| 81 for (size_t i = 0; i < approvals_.size(); ++i) { | 81 for (size_t i = 0; i < approvals_.size(); ++i) { |
| 82 WebstoreInstaller::Approval* approval = approvals_[i]; | 82 WebstoreInstaller::Approval* approval = approvals_[i]; |
| 83 if (approval->extension_id == id && | 83 if (approval->extension_id == id && |
| 84 profile->IsSameProfile(approval->profile)) { | 84 profile->IsSameProfile(approval->profile)) { |
| 85 approvals_.weak_erase(approvals_.begin() + i); | 85 approvals_.weak_erase(approvals_.begin() + i); |
| 86 return scoped_ptr<WebstoreInstaller::Approval>(approval); | 86 return scoped_ptr<WebstoreInstaller::Approval>(approval); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 return scoped_ptr<WebstoreInstaller::Approval>(NULL); | 89 return scoped_ptr<WebstoreInstaller::Approval>(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Uniquely holds the profile and extension id of an install between the time we | 92 // Uniquely holds the profile and extension id of an install between the time we |
| 93 // prompt and complete the installs. | 93 // prompt and complete the installs. |
| 94 class PendingInstalls { | 94 class PendingInstalls { |
| 95 public: | 95 public: |
| 96 PendingInstalls(); | 96 PendingInstalls(); |
| 97 ~PendingInstalls(); | 97 ~PendingInstalls(); |
| 98 | 98 |
| 99 bool InsertInstall(Profile* profile, const std::string& id); | 99 bool InsertInstall(Profile* profile, const std::string& id); |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 SendResponse(true); | 709 SendResponse(true); |
| 710 } | 710 } |
| 711 | 711 |
| 712 bool GetIsLauncherEnabledFunction::RunImpl() { | 712 bool GetIsLauncherEnabledFunction::RunImpl() { |
| 713 SetResult(Value::CreateBooleanValue(apps::IsAppLauncherEnabled())); | 713 SetResult(Value::CreateBooleanValue(apps::IsAppLauncherEnabled())); |
| 714 SendResponse(true); | 714 SendResponse(true); |
| 715 return true; | 715 return true; |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace extensions | 718 } // namespace extensions |
| OLD | NEW |