OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/external_install_error.h" | 5 #include "chrome/browser/extensions/external_install_error.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } else { | 277 } else { |
278 // ... Otherwise we have to do it explicitly. | 278 // ... Otherwise we have to do it explicitly. |
279 manager_->RemoveExternalInstallError(); | 279 manager_->RemoveExternalInstallError(); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 void ExternalInstallError::InstallUIAbort(bool user_initiated) { | 283 void ExternalInstallError::InstallUIAbort(bool user_initiated) { |
284 if (user_initiated && GetExtension()) { | 284 if (user_initiated && GetExtension()) { |
285 ExtensionSystem::Get(browser_context_) | 285 ExtensionSystem::Get(browser_context_) |
286 ->extension_service() | 286 ->extension_service() |
287 ->UninstallExtension(extension_id_, | 287 ->UninstallExtension( |
288 false, // Not externally uninstalled. | 288 extension_id_, |
289 NULL); // Ignore error. | 289 ExtensionService::UNINSTALL_REASON_INSTALL_CANCELED, |
| 290 NULL); // Ignore error. |
290 // Since the manager listens for the extension to be removed, this will | 291 // Since the manager listens for the extension to be removed, this will |
291 // remove the error... | 292 // remove the error... |
292 } else { | 293 } else { |
293 // ... Otherwise we have to do it explicitly. | 294 // ... Otherwise we have to do it explicitly. |
294 manager_->RemoveExternalInstallError(); | 295 manager_->RemoveExternalInstallError(); |
295 } | 296 } |
296 } | 297 } |
297 | 298 |
298 void ExternalInstallError::AcknowledgeExtension() { | 299 void ExternalInstallError::AcknowledgeExtension() { |
299 const Extension* extension = GetExtension(); | 300 const Extension* extension = GetExtension(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (browser) | 392 if (browser) |
392 global_error_->ShowBubbleView(browser); | 393 global_error_->ShowBubbleView(browser); |
393 } else { | 394 } else { |
394 DCHECK(alert_type_ == MENU_ALERT); | 395 DCHECK(alert_type_ == MENU_ALERT); |
395 global_error_.reset(new ExternalInstallMenuAlert(this)); | 396 global_error_.reset(new ExternalInstallMenuAlert(this)); |
396 error_service_->AddGlobalError(global_error_.get()); | 397 error_service_->AddGlobalError(global_error_.get()); |
397 } | 398 } |
398 } | 399 } |
399 | 400 |
400 } // namespace extensions | 401 } // namespace extensions |
OLD | NEW |