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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "extensions/common/permissions/permissions_data.h" | 42 #include "extensions/common/permissions/permissions_data.h" |
43 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
45 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
46 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
47 #include "ui/gfx/image/image.h" | 47 #include "ui/gfx/image/image.h" |
48 #include "ui/gfx/image/image_skia_operations.h" | 48 #include "ui/gfx/image/image_skia_operations.h" |
49 #include "ui/gfx/size.h" | 49 #include "ui/gfx/size.h" |
50 | 50 |
51 using extensions::Extension; | 51 using extensions::Extension; |
| 52 using extensions::UninstalledExtensionInfo; |
52 | 53 |
53 namespace { | 54 namespace { |
54 | 55 |
55 static const int kIconSize = extension_misc::EXTENSION_ICON_SMALL; | 56 static const int kIconSize = extension_misc::EXTENSION_ICON_SMALL; |
56 | 57 |
57 static base::LazyInstance< | 58 static base::LazyInstance< |
58 std::bitset<IDC_EXTENSION_DISABLED_LAST - | 59 std::bitset<IDC_EXTENSION_DISABLED_LAST - |
59 IDC_EXTENSION_DISABLED_FIRST + 1> > | 60 IDC_EXTENSION_DISABLED_FIRST + 1> > |
60 menu_command_ids = LAZY_INSTANCE_INITIALIZER; | 61 menu_command_ids = LAZY_INSTANCE_INITIALIZER; |
61 | 62 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(), |
370 ExtensionService::UNINSTALL_REASON_EXTENSION_DISABLED, | 371 UninstalledExtensionInfo::REASON_EXTENSION_DISABLED, |
371 NULL); | 372 NULL); |
372 } | 373 } |
373 | 374 |
374 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { | 375 void ExtensionDisabledGlobalError::ExtensionUninstallCanceled() { |
375 // Nothing happens, and the error is still there. | 376 // Nothing happens, and the error is still there. |
376 } | 377 } |
377 | 378 |
378 void ExtensionDisabledGlobalError::Observe( | 379 void ExtensionDisabledGlobalError::Observe( |
379 int type, | 380 int type, |
380 const content::NotificationSource& source, | 381 const content::NotificationSource& source, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 void ShowExtensionDisabledDialog(ExtensionService* service, | 438 void ShowExtensionDisabledDialog(ExtensionService* service, |
438 content::WebContents* web_contents, | 439 content::WebContents* web_contents, |
439 const Extension* extension) { | 440 const Extension* extension) { |
440 scoped_ptr<ExtensionInstallPrompt> install_ui( | 441 scoped_ptr<ExtensionInstallPrompt> install_ui( |
441 new ExtensionInstallPrompt(web_contents)); | 442 new ExtensionInstallPrompt(web_contents)); |
442 // This object manages its own lifetime. | 443 // This object manages its own lifetime. |
443 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 444 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
444 } | 445 } |
445 | 446 |
446 } // namespace extensions | 447 } // namespace extensions |
OLD | NEW |