| OLD | NEW |
| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 helpers::DispatchOnBeforeNavigate( | 361 helpers::DispatchOnBeforeNavigate( |
| 362 web_contents(), | 362 web_contents(), |
| 363 render_frame_host, | 363 render_frame_host, |
| 364 navigation_state_.GetUrl(render_frame_host)); | 364 navigation_state_.GetUrl(render_frame_host)); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( | 367 void WebNavigationTabObserver::DidCommitProvisionalLoadForFrame( |
| 368 content::RenderFrameHost* render_frame_host, | 368 content::RenderFrameHost* render_frame_host, |
| 369 const GURL& url, | 369 const GURL& url, |
| 370 bool url_is_unreachable, |
| 370 ui::PageTransition transition_type) { | 371 ui::PageTransition transition_type) { |
| 371 content::RenderViewHost* render_view_host = | 372 content::RenderViewHost* render_view_host = |
| 372 render_frame_host->GetRenderViewHost(); | 373 render_frame_host->GetRenderViewHost(); |
| 373 DVLOG(2) << "DidCommitProvisionalLoad(" | 374 DVLOG(2) << "DidCommitProvisionalLoad(" |
| 374 << "render_view_host=" << render_view_host | 375 << "render_view_host=" << render_view_host |
| 375 << ", frame_num=" << render_frame_host->GetRoutingID() | 376 << ", frame_num=" << render_frame_host->GetRoutingID() |
| 376 << ", url=" << url << ")"; | 377 << ", url=" << url << ")"; |
| 377 if (render_view_host != render_view_host_ && | 378 if (render_view_host != render_view_host_ && |
| 378 render_view_host != pending_render_view_host_) | 379 render_view_host != pending_render_view_host_) |
| 379 return; | 380 return; |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 return g_factory.Pointer(); | 771 return g_factory.Pointer(); |
| 771 } | 772 } |
| 772 | 773 |
| 773 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { | 774 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 774 web_navigation_event_router_.reset(new WebNavigationEventRouter( | 775 web_navigation_event_router_.reset(new WebNavigationEventRouter( |
| 775 Profile::FromBrowserContext(browser_context_))); | 776 Profile::FromBrowserContext(browser_context_))); |
| 776 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 777 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 777 } | 778 } |
| 778 | 779 |
| 779 } // namespace extensions | 780 } // namespace extensions |
| OLD | NEW |