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

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

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 void ExtensionHost::CreateViewWithoutBrowser() { 178 void ExtensionHost::CreateViewWithoutBrowser() {
179 CreateView(NULL); 179 CreateView(NULL);
180 } 180 }
181 181
182 WebContents* ExtensionHost::GetAssociatedWebContents() const { 182 WebContents* ExtensionHost::GetAssociatedWebContents() const {
183 return associated_web_contents_; 183 return associated_web_contents_;
184 } 184 }
185 185
186 content::RenderProcessHost* ExtensionHost::render_process_host() const { 186 content::RenderProcessHost* ExtensionHost::render_process_host() const {
187 return render_view_host()->process(); 187 return render_view_host()->GetProcess();
188 } 188 }
189 189
190 RenderViewHost* ExtensionHost::render_view_host() const { 190 RenderViewHost* ExtensionHost::render_view_host() const {
191 // TODO(mpcomplete): This can be NULL. How do we handle that? 191 // TODO(mpcomplete): This can be NULL. How do we handle that?
192 return render_view_host_; 192 return render_view_host_;
193 } 193 }
194 194
195 bool ExtensionHost::IsRenderViewLive() const { 195 bool ExtensionHost::IsRenderViewLive() const {
196 return render_view_host()->IsRenderViewLive(); 196 return render_view_host()->IsRenderViewLive();
197 } 197 }
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) { 488 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR) {
489 render_view_host->EnablePreferredSizeMode(); 489 render_view_host->EnablePreferredSizeMode();
490 } 490 }
491 491
492 // If the host is bound to a browser, then extract its window id. 492 // If the host is bound to a browser, then extract its window id.
493 // Extensions hosted in ExternalTabContainer objects may not have 493 // Extensions hosted in ExternalTabContainer objects may not have
494 // an associated browser. 494 // an associated browser.
495 const Browser* browser = GetBrowser(); 495 const Browser* browser = GetBrowser();
496 if (browser) { 496 if (browser) {
497 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId( 497 render_view_host->Send(new ExtensionMsg_UpdateBrowserWindowId(
498 render_view_host->routing_id(), 498 render_view_host->GetRoutingID(),
499 ExtensionTabUtil::GetWindowId(browser))); 499 ExtensionTabUtil::GetWindowId(browser)));
500 } 500 }
501 } 501 }
502 502
503 void ExtensionHost::RenderViewDeleted(RenderViewHost* render_view_host) { 503 void ExtensionHost::RenderViewDeleted(RenderViewHost* render_view_host) {
504 // If our RenderViewHost is deleted, fall back to the host_contents' current 504 // If our RenderViewHost is deleted, fall back to the host_contents' current
505 // RVH. There is sometimes a small gap between the pending RVH being deleted 505 // RVH. There is sometimes a small gap between the pending RVH being deleted
506 // and RenderViewCreated being called, so we update it here. 506 // and RenderViewCreated being called, so we update it here.
507 if (render_view_host == render_view_host_) 507 if (render_view_host == render_view_host_)
508 render_view_host_ = host_contents_->GetRenderViewHost(); 508 render_view_host_ = host_contents_->GetRenderViewHost();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 params.user_gesture = user_gesture; 569 params.user_gesture = user_gesture;
570 browser::Navigate(&params); 570 browser::Navigate(&params);
571 } 571 }
572 572
573 void ExtensionHost::RenderViewReady() { 573 void ExtensionHost::RenderViewReady() {
574 content::NotificationService::current()->Notify( 574 content::NotificationService::current()->Notify(
575 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, 575 chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
576 content::Source<Profile>(profile_), 576 content::Source<Profile>(profile_),
577 content::Details<ExtensionHost>(this)); 577 content::Details<ExtensionHost>(this));
578 } 578 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/browser/extensions/extension_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698