Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: chrome/browser/browser.cc

Issue 2134008: Fix browser crash when refreshing extensions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698