| 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 // Defines the Chrome Extensions WebNavigation API functions for observing and | 5 // Defines the Chrome Extensions WebNavigation API functions for observing and |
| 6 // intercepting navigation events, as specified in the extension JSON API. | 6 // intercepting navigation events, as specified in the extension JSON API. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 const GURL& url, | 77 const GURL& url, |
| 78 const content::Referrer& referrer, | 78 const content::Referrer& referrer, |
| 79 WindowOpenDisposition disposition, | 79 WindowOpenDisposition disposition, |
| 80 ui::PageTransition transition) override; | 80 ui::PageTransition transition) override; |
| 81 void WebContentsDestroyed() override; | 81 void WebContentsDestroyed() override; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 explicit WebNavigationTabObserver(content::WebContents* web_contents); | 84 explicit WebNavigationTabObserver(content::WebContents* web_contents); |
| 85 friend class content::WebContentsUserData<WebNavigationTabObserver>; | 85 friend class content::WebContentsUserData<WebNavigationTabObserver>; |
| 86 | 86 |
| 87 void DispatchErrorToHelper(content::RenderFrameHost* render_frame_host, |
| 88 int error_code); |
| 89 |
| 87 // True if the transition and target url correspond to a reference fragment | 90 // True if the transition and target url correspond to a reference fragment |
| 88 // navigation. | 91 // navigation. |
| 89 bool IsReferenceFragmentNavigation(content::RenderFrameHost* frame_host, | 92 bool IsReferenceFragmentNavigation(content::RenderFrameHost* frame_host, |
| 90 const GURL& url); | 93 const GURL& url); |
| 91 | 94 |
| 92 // Creates and sends onErrorOccurred events for all on-going navigations. If | 95 // Creates and sends onErrorOccurred events for all on-going navigations. If |
| 93 // |render_view_host| is non-NULL, only generates events for frames in this | 96 // |render_view_host| is non-NULL, only generates events for frames in this |
| 94 // render view host. If |frame_host_to_skip| is given, no events are sent for | 97 // render view host. If |frame_host_to_skip| is given, no events are sent for |
| 95 // that | 98 // that |
| 96 // frame. | 99 // frame. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 219 |
| 217 // Created lazily upon OnListenerAdded. | 220 // Created lazily upon OnListenerAdded. |
| 218 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; | 221 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; |
| 219 | 222 |
| 220 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); | 223 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); |
| 221 }; | 224 }; |
| 222 | 225 |
| 223 } // namespace extensions | 226 } // namespace extensions |
| 224 | 227 |
| 225 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 228 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| OLD | NEW |