| 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 navigation_state_.SetErrorOccurredInFrame(frame_id); | 584 navigation_state_.SetErrorOccurredInFrame(frame_id); |
| 585 } | 585 } |
| 586 | 586 |
| 587 void WebNavigationTabObserver::DidGetRedirectForResourceRequest( | 587 void WebNavigationTabObserver::DidGetRedirectForResourceRequest( |
| 588 content::RenderViewHost* render_view_host, | 588 content::RenderViewHost* render_view_host, |
| 589 const content::ResourceRedirectDetails& details) { | 589 const content::ResourceRedirectDetails& details) { |
| 590 if (details.resource_type != ResourceType::MAIN_FRAME && | 590 if (details.resource_type != ResourceType::MAIN_FRAME && |
| 591 details.resource_type != ResourceType::SUB_FRAME) { | 591 details.resource_type != ResourceType::SUB_FRAME) { |
| 592 return; | 592 return; |
| 593 } | 593 } |
| 594 FrameNavigationState::FrameID frame_id(details.frame_id, render_view_host); | 594 FrameNavigationState::FrameID frame_id(details.render_frame_id, |
| 595 render_view_host); |
| 595 navigation_state_.SetIsServerRedirected(frame_id); | 596 navigation_state_.SetIsServerRedirected(frame_id); |
| 596 } | 597 } |
| 597 | 598 |
| 598 void WebNavigationTabObserver::DidOpenRequestedURL( | 599 void WebNavigationTabObserver::DidOpenRequestedURL( |
| 599 content::WebContents* new_contents, | 600 content::WebContents* new_contents, |
| 600 const GURL& url, | 601 const GURL& url, |
| 601 const content::Referrer& referrer, | 602 const content::Referrer& referrer, |
| 602 WindowOpenDisposition disposition, | 603 WindowOpenDisposition disposition, |
| 603 content::PageTransition transition, | 604 content::PageTransition transition, |
| 604 int64 source_frame_num) { | 605 int64 source_frame_num) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { | 841 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 841 web_navigation_event_router_.reset(new WebNavigationEventRouter( | 842 web_navigation_event_router_.reset(new WebNavigationEventRouter( |
| 842 Profile::FromBrowserContext(browser_context_))); | 843 Profile::FromBrowserContext(browser_context_))); |
| 843 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 844 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
| 844 this); | 845 this); |
| 845 } | 846 } |
| 846 | 847 |
| 847 #endif // OS_ANDROID | 848 #endif // OS_ANDROID |
| 848 | 849 |
| 849 } // namespace extensions | 850 } // namespace extensions |
| OLD | NEW |