| 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_disabled_ui.h" | 5 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 6 | 6 |
| 7 #include <bitset> | 7 #include <bitset> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/ui/global_error/global_error.h" | 26 #include "chrome/browser/ui/global_error/global_error.h" |
| 27 #include "chrome/browser/ui/global_error/global_error_service.h" | 27 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 28 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 28 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 30 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
| 31 #include "content/public/browser/notification_observer.h" | 31 #include "content/public/browser/notification_observer.h" |
| 32 #include "content/public/browser/notification_registrar.h" | 32 #include "content/public/browser/notification_registrar.h" |
| 33 #include "content/public/browser/notification_source.h" | 33 #include "content/public/browser/notification_source.h" |
| 34 #include "extensions/browser/extension_util.h" | 34 #include "extensions/browser/extension_util.h" |
| 35 #include "extensions/browser/image_loader.h" | 35 #include "extensions/browser/image_loader.h" |
| 36 #include "extensions/browser/uninstall_reason.h" |
| 36 #include "extensions/common/constants.h" | 37 #include "extensions/common/constants.h" |
| 37 #include "extensions/common/extension.h" | 38 #include "extensions/common/extension.h" |
| 38 #include "extensions/common/extension_icon_set.h" | 39 #include "extensions/common/extension_icon_set.h" |
| 39 #include "extensions/common/manifest_handlers/icons_handler.h" | 40 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 40 #include "extensions/common/permissions/permission_message_provider.h" | 41 #include "extensions/common/permissions/permission_message_provider.h" |
| 41 #include "extensions/common/permissions/permission_set.h" | 42 #include "extensions/common/permissions/permission_set.h" |
| 42 #include "extensions/common/permissions/permissions_data.h" | 43 #include "extensions/common/permissions/permissions_data.h" |
| 43 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
| 44 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 45 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 360 |
| 360 bool ExtensionDisabledGlobalError::ShouldCloseOnDeactivate() const { | 361 bool ExtensionDisabledGlobalError::ShouldCloseOnDeactivate() const { |
| 361 // Since this indicates that an extension was disabled, we should definitely | 362 // Since this indicates that an extension was disabled, we should definitely |
| 362 // have the user acknowledge it, rather than having the bubble disappear when | 363 // have the user acknowledge it, rather than having the bubble disappear when |
| 363 // a new window pops up. | 364 // a new window pops up. |
| 364 return false; | 365 return false; |
| 365 } | 366 } |
| 366 | 367 |
| 367 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { | 368 void ExtensionDisabledGlobalError::ExtensionUninstallAccepted() { |
| 368 service_->UninstallExtension( | 369 service_->UninstallExtension( |
| 369 extension_->id(), | 370 extension_->id(), extensions::UNINSTALL_REASON_EXTENSION_DISABLED, NULL); |
| 370 ExtensionService::UNINSTALL_REASON_EXTENSION_DISABLED, | |
| 371 NULL); | |
| 372 } | 371 } |
| 373 | 372 |
| 374 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 373 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
| 375 // Nothing happens, and the error is still there. | 374 // Nothing happens, and the error is still there. |
| 376 } | 375 } |
| 377 | 376 |
| 378 void ExtensionDisabledGlobalError::Observe( | 377 void ExtensionDisabledGlobalError::Observe( |
| 379 int type, | 378 int type, |
| 380 const content::NotificationSource& source, | 379 const content::NotificationSource& source, |
| 381 const content::NotificationDetails& details) { | 380 const content::NotificationDetails& details) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 void ShowExtensionDisabledDialog(ExtensionService* service, | 436 void ShowExtensionDisabledDialog(ExtensionService* service, |
| 438 content::WebContents* web_contents, | 437 content::WebContents* web_contents, |
| 439 const Extension* extension) { | 438 const Extension* extension) { |
| 440 scoped_ptr<ExtensionInstallPrompt> install_ui( | 439 scoped_ptr<ExtensionInstallPrompt> install_ui( |
| 441 new ExtensionInstallPrompt(web_contents)); | 440 new ExtensionInstallPrompt(web_contents)); |
| 442 // This object manages its own lifetime. | 441 // This object manages its own lifetime. |
| 443 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 442 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
| 444 } | 443 } |
| 445 | 444 |
| 446 } // namespace extensions | 445 } // namespace extensions |
| OLD | NEW |