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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2898 break; | 2898 break; |
2899 ExtensionsService* extensions_service = | 2899 ExtensionsService* extensions_service = |
2900 Source<Profile>(source).ptr()->GetExtensionsService(); | 2900 Source<Profile>(source).ptr()->GetExtensionsService(); |
2901 ExtensionHost* extension_host = Details<ExtensionHost>(details).ptr(); | 2901 ExtensionHost* extension_host = Details<ExtensionHost>(details).ptr(); |
2902 tab_contents->AddInfoBar(new CrashedExtensionInfoBarDelegate( | 2902 tab_contents->AddInfoBar(new CrashedExtensionInfoBarDelegate( |
2903 tab_contents, extensions_service, extension_host->extension())); | 2903 tab_contents, extensions_service, extension_host->extension())); |
2904 break; | 2904 break; |
2905 } | 2905 } |
2906 | 2906 |
2907 case NotificationType::EXTENSION_LOADED: { | 2907 case NotificationType::EXTENSION_LOADED: { |
| 2908 window()->GetLocationBar()->UpdatePageActions(); |
| 2909 |
2908 // If any "This extension has crashed" InfoBarDelegates are around for | 2910 // If any "This extension has crashed" InfoBarDelegates are around for |
2909 // this extension, it means that it has been reloaded in another window | 2911 // this extension, it means that it has been reloaded in another window |
2910 // so just remove the remaining CrashedExtensionInfoBarDelegate objects. | 2912 // so just remove the remaining CrashedExtensionInfoBarDelegate objects. |
2911 TabContents* tab_contents = GetSelectedTabContents(); | 2913 TabContents* tab_contents = GetSelectedTabContents(); |
2912 if (!tab_contents) | 2914 if (!tab_contents) |
2913 break; | 2915 break; |
2914 Extension* extension = Details<Extension>(details).ptr(); | 2916 Extension* extension = Details<Extension>(details).ptr(); |
2915 CrashedExtensionInfoBarDelegate* delegate = NULL; | 2917 CrashedExtensionInfoBarDelegate* delegate = NULL; |
2916 for (int i = 0; i < tab_contents->infobar_delegate_count();) { | 2918 for (int i = 0; i < tab_contents->infobar_delegate_count();) { |
2917 delegate = tab_contents->GetInfoBarDelegateAt(i)-> | 2919 delegate = tab_contents->GetInfoBarDelegateAt(i)-> |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3860 if (TabHasUnloadListener(contents)) { | 3862 if (TabHasUnloadListener(contents)) { |
3861 // If the page has unload listeners, then we tell the renderer to fire | 3863 // If the page has unload listeners, then we tell the renderer to fire |
3862 // them. Once they have fired, we'll get a message back saying whether | 3864 // them. Once they have fired, we'll get a message back saying whether |
3863 // to proceed closing the page or not, which sends us back to this method | 3865 // to proceed closing the page or not, which sends us back to this method |
3864 // with the HasUnloadListener bit cleared. | 3866 // with the HasUnloadListener bit cleared. |
3865 contents->render_view_host()->FirePageBeforeUnload(false); | 3867 contents->render_view_host()->FirePageBeforeUnload(false); |
3866 return true; | 3868 return true; |
3867 } | 3869 } |
3868 return false; | 3870 return false; |
3869 } | 3871 } |
OLD | NEW |