| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/dashboard_private/dashboard_private_api.
h" | 5 #include "chrome/browser/extensions/api/dashboard_private/dashboard_private_api.
h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 // The response is sent in OnFetchComplete or OnInstallApproval. | 235 // The response is sent in OnFetchComplete or OnInstallApproval. |
| 236 return RespondLater(); | 236 return RespondLater(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void DashboardPrivateShowPermissionPromptForDelegatedBundleInstallFunction:: | 239 void DashboardPrivateShowPermissionPromptForDelegatedBundleInstallFunction:: |
| 240 OnFetchComplete(const GURL& url, const SkBitmap* bitmap) { | 240 OnFetchComplete(const GURL& url, const SkBitmap* bitmap) { |
| 241 BundleInstaller::ItemList items; | 241 BundleInstaller::ItemList items; |
| 242 for (const auto& entry : params_->contents) { | 242 for (const auto& entry : params_->contents) { |
| 243 BundleInstaller::Item item; | 243 BundleInstaller::Item item; |
| 244 item.id = entry->id; | 244 item.id = entry.id; |
| 245 item.manifest = entry->manifest; | 245 item.manifest = entry.manifest; |
| 246 item.localized_name = entry->localized_name; | 246 item.localized_name = entry.localized_name; |
| 247 if (entry->icon_url) | 247 if (entry.icon_url) |
| 248 item.icon_url = source_url().Resolve(*entry->icon_url); | 248 item.icon_url = source_url().Resolve(*entry.icon_url); |
| 249 items.push_back(item); | 249 items.push_back(item); |
| 250 } | 250 } |
| 251 if (items.empty()) { | 251 if (items.empty()) { |
| 252 Respond(Error(kAlreadyInstalledError)); | 252 Respond(Error(kAlreadyInstalledError)); |
| 253 Release(); // Matches the AddRef in Run. | 253 Release(); // Matches the AddRef in Run. |
| 254 return; | 254 return; |
| 255 } | 255 } |
| 256 | 256 |
| 257 bundle_.reset(new BundleInstaller(chrome_details_.GetCurrentBrowser(), | 257 bundle_.reset(new BundleInstaller(chrome_details_.GetCurrentBrowser(), |
| 258 params_->details.localized_name, | 258 params_->details.localized_name, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 275 ? kUserCancelledError | 275 ? kUserCancelledError |
| 276 : kInvalidBundleError)); | 276 : kInvalidBundleError)); |
| 277 return; | 277 return; |
| 278 } | 278 } |
| 279 | 279 |
| 280 Respond(NoArguments()); | 280 Respond(NoArguments()); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace extensions | 283 } // namespace extensions |
| 284 | 284 |
| OLD | NEW |