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

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

Issue 149416: Properly restart extensions with no visible UI. (Closed) Base URL: http://src.chromium.org/svn/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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void ExtensionHost::CreateRenderView(RenderWidgetHostView* host_view) { 129 void ExtensionHost::CreateRenderView(RenderWidgetHostView* host_view) {
130 render_view_host_->set_view(host_view); 130 render_view_host_->set_view(host_view);
131 render_view_host_->CreateRenderView(); 131 render_view_host_->CreateRenderView();
132 render_view_host_->NavigateToURL(url_); 132 render_view_host_->NavigateToURL(url_);
133 } 133 }
134 134
135 void ExtensionHost::RecoverCrashedExtension() { 135 void ExtensionHost::RecoverCrashedExtension() {
136 DCHECK(!IsRenderViewLive()); 136 DCHECK(!IsRenderViewLive());
137 #if defined(TOOLKIT_VIEWS) 137 #if defined(TOOLKIT_VIEWS)
138 view_->RecoverCrashedExtension(); 138 if (view_.get()) {
139 view_->RecoverCrashedExtension();
140 } else {
141 CreateRenderView(NULL);
142 }
143 #else
144 CreateRenderView(NULL);
139 #endif 145 #endif
140 if (IsRenderViewLive()) { 146 if (IsRenderViewLive()) {
141 NotificationService::current()->Notify( 147 NotificationService::current()->Notify(
142 NotificationType::EXTENSION_PROCESS_RESTORED, 148 NotificationType::EXTENSION_PROCESS_RESTORED,
143 Source<Profile>(profile_), 149 Source<Profile>(profile_),
144 Details<ExtensionHost>(this)); 150 Details<ExtensionHost>(this));
145 } 151 }
146 } 152 }
147 153
148 void ExtensionHost::UpdatePreferredWidth(int pref_width) { 154 void ExtensionHost::UpdatePreferredWidth(int pref_width) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // A similar situation may arise during shutdown. 317 // A similar situation may arise during shutdown.
312 // TODO(rafaelw): Delay creation of background_page until the browser 318 // TODO(rafaelw): Delay creation of background_page until the browser
313 // is available. http://code.google.com/p/chromium/issues/detail?id=13284 319 // is available. http://code.google.com/p/chromium/issues/detail?id=13284
314 return browser; 320 return browser;
315 } 321 }
316 322
317 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { 323 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) {
318 extension_function_dispatcher_.reset( 324 extension_function_dispatcher_.reset(
319 new ExtensionFunctionDispatcher(render_view_host_, this, url_)); 325 new ExtensionFunctionDispatcher(render_view_host_, this, url_));
320 } 326 }
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