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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 virtual void AboutToNavigateRenderView( | 59 virtual void AboutToNavigateRenderView( |
60 content::RenderViewHost* render_view_host) OVERRIDE; | 60 content::RenderViewHost* render_view_host) OVERRIDE; |
61 virtual void DidStartProvisionalLoadForFrame( | 61 virtual void DidStartProvisionalLoadForFrame( |
62 content::RenderFrameHost* render_frame_host, | 62 content::RenderFrameHost* render_frame_host, |
63 const GURL& validated_url, | 63 const GURL& validated_url, |
64 bool is_error_page, | 64 bool is_error_page, |
65 bool is_iframe_srcdoc) OVERRIDE; | 65 bool is_iframe_srcdoc) OVERRIDE; |
66 virtual void DidCommitProvisionalLoadForFrame( | 66 virtual void DidCommitProvisionalLoadForFrame( |
67 content::RenderFrameHost* render_frame_host, | 67 content::RenderFrameHost* render_frame_host, |
68 const GURL& url, | 68 const GURL& url, |
69 content::PageTransition transition_type) OVERRIDE; | 69 ui::PageTransition transition_type) OVERRIDE; |
70 virtual void DidFailProvisionalLoad( | 70 virtual void DidFailProvisionalLoad( |
71 content::RenderFrameHost* render_frame_host, | 71 content::RenderFrameHost* render_frame_host, |
72 const GURL& validated_url, | 72 const GURL& validated_url, |
73 int error_code, | 73 int error_code, |
74 const base::string16& error_description) OVERRIDE; | 74 const base::string16& error_description) OVERRIDE; |
75 virtual void DocumentLoadedInFrame( | 75 virtual void DocumentLoadedInFrame( |
76 content::RenderFrameHost* render_frame_host) OVERRIDE; | 76 content::RenderFrameHost* render_frame_host) OVERRIDE; |
77 virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 77 virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
78 const GURL& validated_url) OVERRIDE; | 78 const GURL& validated_url) OVERRIDE; |
79 virtual void DidFailLoad(content::RenderFrameHost* render_frame_host, | 79 virtual void DidFailLoad(content::RenderFrameHost* render_frame_host, |
80 const GURL& validated_url, | 80 const GURL& validated_url, |
81 int error_code, | 81 int error_code, |
82 const base::string16& error_description) OVERRIDE; | 82 const base::string16& error_description) OVERRIDE; |
83 virtual void DidGetRedirectForResourceRequest( | 83 virtual void DidGetRedirectForResourceRequest( |
84 content::RenderViewHost* render_view_host, | 84 content::RenderViewHost* render_view_host, |
85 const content::ResourceRedirectDetails& details) OVERRIDE; | 85 const content::ResourceRedirectDetails& details) OVERRIDE; |
86 virtual void DidOpenRequestedURL(content::WebContents* new_contents, | 86 virtual void DidOpenRequestedURL(content::WebContents* new_contents, |
87 const GURL& url, | 87 const GURL& url, |
88 const content::Referrer& referrer, | 88 const content::Referrer& referrer, |
89 WindowOpenDisposition disposition, | 89 WindowOpenDisposition disposition, |
90 content::PageTransition transition, | 90 ui::PageTransition transition, |
91 int64 source_frame_num) OVERRIDE; | 91 int64 source_frame_num) OVERRIDE; |
92 virtual void WebContentsDestroyed() OVERRIDE; | 92 virtual void WebContentsDestroyed() OVERRIDE; |
93 | 93 |
94 private: | 94 private: |
95 explicit WebNavigationTabObserver(content::WebContents* web_contents); | 95 explicit WebNavigationTabObserver(content::WebContents* web_contents); |
96 friend class content::WebContentsUserData<WebNavigationTabObserver>; | 96 friend class content::WebContentsUserData<WebNavigationTabObserver>; |
97 | 97 |
98 // True if the transition and target url correspond to a reference fragment | 98 // True if the transition and target url correspond to a reference fragment |
99 // navigation. | 99 // navigation. |
100 bool IsReferenceFragmentNavigation(content::RenderFrameHost* frame_host, | 100 bool IsReferenceFragmentNavigation(content::RenderFrameHost* frame_host, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 // Created lazily upon OnListenerAdded. | 236 // Created lazily upon OnListenerAdded. |
237 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; | 237 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; |
238 | 238 |
239 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); | 239 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); |
240 }; | 240 }; |
241 | 241 |
242 } // namespace extensions | 242 } // namespace extensions |
243 | 243 |
244 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 244 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
OLD | NEW |