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

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

Issue 10779042: Move notifications only used in chrome/ to chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix oops Created 8 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
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/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 // Register for our parent profile to shutdown, so we can shut ourselves down 352 // Register for our parent profile to shutdown, so we can shut ourselves down
353 // as well (should only be called for OTR profiles, as we should receive 353 // as well (should only be called for OTR profiles, as we should receive
354 // APP_TERMINATING before non-OTR profiles are destroyed). 354 // APP_TERMINATING before non-OTR profiles are destroyed).
355 // TODO(tburkard): figure out if this is needed. 355 // TODO(tburkard): figure out if this is needed.
356 notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, 356 notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
357 content::Source<Profile>(profile_)); 357 content::Source<Profile>(profile_));
358 358
359 // Register to inform new RenderViews that we're prerendering. 359 // Register to inform new RenderViews that we're prerendering.
360 notification_registrar_.Add( 360 notification_registrar_.Add(
361 this, content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, 361 this, content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED,
362 content::Source<WebContents>(new_contents)); 362 content::Source<WebContents>(new_contents));
363 363
364 // Register for redirect notifications sourced from |this|. 364 // Register for redirect notifications sourced from |this|.
365 notification_registrar_.Add( 365 notification_registrar_.Add(
366 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 366 this, content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
367 content::Source<WebContents>(GetWebContents())); 367 content::Source<WebContents>(GetWebContents()));
368 368
369 // Transfer over the user agent override. 369 // Transfer over the user agent override.
370 new_contents->SetUserAgentOverride( 370 new_contents->SetUserAgentOverride(
371 prerender_manager_->config().user_agent_override); 371 prerender_manager_->config().user_agent_override);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 content::Details<ResourceRedirectDetails>(details).ptr(); 451 content::Details<ResourceRedirectDetails>(details).ptr();
452 CHECK(resource_redirect_details); 452 CHECK(resource_redirect_details);
453 if (resource_redirect_details->resource_type == 453 if (resource_redirect_details->resource_type ==
454 ResourceType::MAIN_FRAME) { 454 ResourceType::MAIN_FRAME) {
455 if (!AddAliasURL(resource_redirect_details->new_url)) 455 if (!AddAliasURL(resource_redirect_details->new_url))
456 return; 456 return;
457 } 457 }
458 break; 458 break;
459 } 459 }
460 460
461 case content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB: { 461 case content::NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED: {
462 if (prerender_contents_.get()) { 462 if (prerender_contents_.get()) {
463 DCHECK_EQ(content::Source<WebContents>(source).ptr(), 463 DCHECK_EQ(content::Source<WebContents>(source).ptr(),
464 prerender_contents_->web_contents()); 464 prerender_contents_->web_contents());
465 465
466 content::Details<RenderViewHost> new_render_view_host(details); 466 content::Details<RenderViewHost> new_render_view_host(details);
467 OnRenderViewHostCreated(new_render_view_host.ptr()); 467 OnRenderViewHostCreated(new_render_view_host.ptr());
468 468
469 // When a new RenderView is created for a prerendering WebContents, 469 // When a new RenderView is created for a prerendering WebContents,
470 // tell the new RenderView it's being used for prerendering before any 470 // tell the new RenderView it's being used for prerendering before any
471 // navigations occur. Note that this is always triggered before the 471 // navigations occur. Note that this is always triggered before the
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 bool PrerenderContents::IsCrossSiteNavigationPending() const { 705 bool PrerenderContents::IsCrossSiteNavigationPending() const {
706 if (!prerender_contents_.get() || !prerender_contents_->web_contents()) 706 if (!prerender_contents_.get() || !prerender_contents_->web_contents())
707 return false; 707 return false;
708 const WebContents* web_contents = prerender_contents_->web_contents(); 708 const WebContents* web_contents = prerender_contents_->web_contents();
709 return (web_contents->GetSiteInstance() != 709 return (web_contents->GetSiteInstance() !=
710 web_contents->GetPendingSiteInstance()); 710 web_contents->GetPendingSiteInstance());
711 } 711 }
712 712
713 713
714 } // namespace prerender 714 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698