| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 if (extension) { | 479 if (extension) { |
| 480 GlobalErrorServiceFactory::GetForProfile(service->profile()) | 480 GlobalErrorServiceFactory::GetForProfile(service->profile()) |
| 481 ->AddGlobalError(new ExtensionDisabledGlobalError( | 481 ->AddGlobalError(new ExtensionDisabledGlobalError( |
| 482 service.get(), extension, is_remote_install, icon)); | 482 service.get(), extension, is_remote_install, icon)); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 void AddExtensionDisabledError(ExtensionService* service, | 486 void AddExtensionDisabledError(ExtensionService* service, |
| 487 const Extension* extension, | 487 const Extension* extension, |
| 488 bool is_remote_install) { | 488 bool is_remote_install) { |
| 489 // Do not display notifications for ephemeral apps that have been disabled. | |
| 490 // Instead, a prompt will be shown the next time the app is launched. | |
| 491 if (util::IsEphemeralApp(extension->id(), service->profile())) | |
| 492 return; | |
| 493 | |
| 494 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( | 489 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( |
| 495 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER); | 490 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER); |
| 496 gfx::Size size(kIconSize, kIconSize); | 491 gfx::Size size(kIconSize, kIconSize); |
| 497 ImageLoader::Get(service->profile()) | 492 ImageLoader::Get(service->profile()) |
| 498 ->LoadImageAsync(extension, | 493 ->LoadImageAsync(extension, |
| 499 image, | 494 image, |
| 500 size, | 495 size, |
| 501 base::Bind(&AddExtensionDisabledErrorWithIcon, | 496 base::Bind(&AddExtensionDisabledErrorWithIcon, |
| 502 service->AsWeakPtr(), | 497 service->AsWeakPtr(), |
| 503 extension->id(), | 498 extension->id(), |
| 504 is_remote_install)); | 499 is_remote_install)); |
| 505 } | 500 } |
| 506 | 501 |
| 507 void ShowExtensionDisabledDialog(ExtensionService* service, | 502 void ShowExtensionDisabledDialog(ExtensionService* service, |
| 508 content::WebContents* web_contents, | 503 content::WebContents* web_contents, |
| 509 const Extension* extension) { | 504 const Extension* extension) { |
| 510 scoped_ptr<ExtensionInstallPrompt> install_ui( | 505 scoped_ptr<ExtensionInstallPrompt> install_ui( |
| 511 new ExtensionInstallPrompt(web_contents)); | 506 new ExtensionInstallPrompt(web_contents)); |
| 512 // This object manages its own lifetime. | 507 // This object manages its own lifetime. |
| 513 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 508 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
| 514 } | 509 } |
| 515 | 510 |
| 516 } // namespace extensions | 511 } // namespace extensions |
| OLD | NEW |