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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc

Issue 868673002: OOPIF: report both original and destination rfh in AboutToNavigateRenderFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 5 years, 11 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
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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 } else if (render_view_host == pending_render_view_host_) { 318 } else if (render_view_host == pending_render_view_host_) {
319 pending_render_view_host_ = NULL; 319 pending_render_view_host_ = NULL;
320 } else { 320 } else {
321 return; 321 return;
322 } 322 }
323 SendErrorEvents(web_contents(), render_view_host, NULL); 323 SendErrorEvents(web_contents(), render_view_host, NULL);
324 } 324 }
325 325
326 void WebNavigationTabObserver::AboutToNavigateRenderFrame( 326 void WebNavigationTabObserver::AboutToNavigateRenderFrame(
327 content::RenderFrameHost* render_frame_host) { 327 content::RenderFrameHost* old_host,
328 content::RenderFrameHost* new_host) {
328 content::RenderViewHost* render_view_host = 329 content::RenderViewHost* render_view_host =
329 render_frame_host->GetRenderViewHost(); 330 new_host->GetRenderViewHost();
330 if (!render_view_host_) { 331 if (!render_view_host_) {
331 render_view_host_ = render_view_host; 332 render_view_host_ = render_view_host;
332 } else if (render_view_host != render_view_host_) { 333 } else if (render_view_host != render_view_host_) {
333 if (pending_render_view_host_) { 334 if (pending_render_view_host_) {
334 SendErrorEvents(web_contents(), pending_render_view_host_, NULL); 335 SendErrorEvents(web_contents(), pending_render_view_host_, NULL);
335 } 336 }
336 pending_render_view_host_ = render_view_host; 337 pending_render_view_host_ = render_view_host;
337 } 338 }
338 } 339 }
339 340
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 return g_factory.Pointer(); 767 return g_factory.Pointer();
767 } 768 }
768 769
769 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { 770 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) {
770 web_navigation_event_router_.reset(new WebNavigationEventRouter( 771 web_navigation_event_router_.reset(new WebNavigationEventRouter(
771 Profile::FromBrowserContext(browser_context_))); 772 Profile::FromBrowserContext(browser_context_)));
772 EventRouter::Get(browser_context_)->UnregisterObserver(this); 773 EventRouter::Get(browser_context_)->UnregisterObserver(this);
773 } 774 }
774 775
775 } // namespace extensions 776 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698