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

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

Issue 149205: Fixing a crash in RenderViewGone.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | no next file » | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 void ExtensionHost::UpdatePreferredWidth(int pref_width) { 148 void ExtensionHost::UpdatePreferredWidth(int pref_width) {
149 #if defined(OS_WIN) 149 #if defined(OS_WIN)
150 if (view_.get()) 150 if (view_.get())
151 view_->DidContentsPreferredWidthChange(pref_width); 151 view_->DidContentsPreferredWidthChange(pref_width);
152 #endif 152 #endif
153 } 153 }
154 154
155 void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host) { 155 void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host) {
156 DCHECK_EQ(render_view_host_, render_view_host); 156 DCHECK_EQ(render_view_host_, render_view_host);
157 TabContents* current_tab = GetBrowser()->GetSelectedTabContents(); 157 Browser* browser = GetBrowser();
158 if (current_tab) { 158 if (browser) {
159 current_tab->AddInfoBar( 159 TabContents* current_tab = browser->GetSelectedTabContents();
160 new CrashedExtensionInfobarDelegate(current_tab, this)); 160 if (current_tab) {
161 current_tab->AddInfoBar(
162 new CrashedExtensionInfobarDelegate(current_tab, this));
163 }
161 } 164 }
162 NotificationService::current()->Notify( 165 NotificationService::current()->Notify(
163 NotificationType::EXTENSION_PROCESS_CRASHED, 166 NotificationType::EXTENSION_PROCESS_CRASHED,
164 Source<Profile>(profile_), 167 Source<Profile>(profile_),
165 Details<ExtensionHost>(this)); 168 Details<ExtensionHost>(this));
166 } 169 }
167 170
168 WebPreferences ExtensionHost::GetWebkitPrefs() { 171 WebPreferences ExtensionHost::GetWebkitPrefs() {
169 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs(); 172 PrefService* prefs = render_view_host()->process()->profile()->GetPrefs();
170 const bool kIsDomUI = true; 173 const bool kIsDomUI = true;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 int request_id, 312 int request_id,
310 bool has_callback) { 313 bool has_callback) {
311 extension_function_dispatcher_->HandleRequest(message, content, request_id, 314 extension_function_dispatcher_->HandleRequest(message, content, request_id,
312 has_callback); 315 has_callback);
313 } 316 }
314 317
315 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { 318 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) {
316 extension_function_dispatcher_.reset( 319 extension_function_dispatcher_.reset(
317 new ExtensionFunctionDispatcher(render_view_host_, this, url_)); 320 new ExtensionFunctionDispatcher(render_view_host_, this, url_));
318 } 321 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698