OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "app/animation.h" | 10 #include "app/animation.h" |
(...skipping 2559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 // (NavigationControllers) for convenience, so the notification could | 2570 // (NavigationControllers) for convenience, so the notification could |
2571 // actually be for a different window while we're doing asynchronous | 2571 // actually be for a different window while we're doing asynchronous |
2572 // closing of this one. | 2572 // closing of this one. |
2573 if (GetSelectedTabContents() && | 2573 if (GetSelectedTabContents() && |
2574 &GetSelectedTabContents()->controller() == | 2574 &GetSelectedTabContents()->controller() == |
2575 Source<NavigationController>(source).ptr()) | 2575 Source<NavigationController>(source).ptr()) |
2576 UpdateToolbar(false); | 2576 UpdateToolbar(false); |
2577 break; | 2577 break; |
2578 | 2578 |
2579 case NotificationType::EXTENSION_UPDATE_DISABLED: { | 2579 case NotificationType::EXTENSION_UPDATE_DISABLED: { |
2580 // Show the UI. | 2580 // Show the UI if the extension was disabled for escalated permissions. |
2581 Profile* profile = Source<Profile>(source).ptr(); | 2581 Profile* profile = Source<Profile>(source).ptr(); |
2582 DCHECK_EQ(profile_, profile); | 2582 DCHECK_EQ(profile_, profile); |
2583 ExtensionsService* service = profile->GetExtensionsService(); | 2583 ExtensionsService* service = profile->GetExtensionsService(); |
2584 DCHECK(service); | 2584 DCHECK(service); |
2585 Extension* extension = Details<Extension>(details).ptr(); | 2585 Extension* extension = Details<Extension>(details).ptr(); |
2586 ShowExtensionDisabledUI(service, profile_, extension); | 2586 if (service->extension_prefs()->DidExtensionEscalatePermissions( |
| 2587 extension->id())) |
| 2588 ShowExtensionDisabledUI(service, profile_, extension); |
2587 break; | 2589 break; |
2588 } | 2590 } |
2589 | 2591 |
2590 case NotificationType::EXTENSION_UNLOADED: | 2592 case NotificationType::EXTENSION_UNLOADED: |
2591 case NotificationType::EXTENSION_UNLOADED_DISABLED: { | 2593 case NotificationType::EXTENSION_UNLOADED_DISABLED: { |
2592 window()->GetLocationBar()->UpdatePageActions(); | 2594 window()->GetLocationBar()->UpdatePageActions(); |
2593 | 2595 |
2594 // Close any tabs from the unloaded extension. | 2596 // Close any tabs from the unloaded extension. |
2595 Extension* extension = Details<Extension>(details).ptr(); | 2597 Extension* extension = Details<Extension>(details).ptr(); |
2596 for (int i = 0; i < tabstrip_model_.count(); i++) { | 2598 for (int i = 0; i < tabstrip_model_.count(); i++) { |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3456 if (TabHasUnloadListener(contents)) { | 3458 if (TabHasUnloadListener(contents)) { |
3457 // If the page has unload listeners, then we tell the renderer to fire | 3459 // If the page has unload listeners, then we tell the renderer to fire |
3458 // them. Once they have fired, we'll get a message back saying whether | 3460 // them. Once they have fired, we'll get a message back saying whether |
3459 // to proceed closing the page or not, which sends us back to this method | 3461 // to proceed closing the page or not, which sends us back to this method |
3460 // with the HasUnloadListener bit cleared. | 3462 // with the HasUnloadListener bit cleared. |
3461 contents->render_view_host()->FirePageBeforeUnload(false); | 3463 contents->render_view_host()->FirePageBeforeUnload(false); |
3462 return true; | 3464 return true; |
3463 } | 3465 } |
3464 return false; | 3466 return false; |
3465 } | 3467 } |
OLD | NEW |