OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 // intercepting navigation events, as specified in |
7 // chrome/common/extensions/api/extension_api.json. | 7 // chrome/common/extensions/api/extension_api.json. |
8 | 8 |
9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
(...skipping 20 matching lines...) Expand all Loading... |
31 ~FrameNavigationState(); | 31 ~FrameNavigationState(); |
32 | 32 |
33 // True if navigation events for the given frame can be sent. | 33 // True if navigation events for the given frame can be sent. |
34 bool CanSendEvents(int64 frame_id) const; | 34 bool CanSendEvents(int64 frame_id) const; |
35 | 35 |
36 // Starts to track a frame given by its |frame_id| showing the URL |url| in | 36 // Starts to track a frame given by its |frame_id| showing the URL |url| in |
37 // a |tab_contents|. | 37 // a |tab_contents|. |
38 void TrackFrame(int64 frame_id, | 38 void TrackFrame(int64 frame_id, |
39 const GURL& url, | 39 const GURL& url, |
40 bool is_main_frame, | 40 bool is_main_frame, |
| 41 bool is_error_page, |
41 const TabContents* tab_contents); | 42 const TabContents* tab_contents); |
42 | 43 |
43 // Returns the URL corresponding to a tracked frame given by its |frame_id|. | 44 // Returns the URL corresponding to a tracked frame given by its |frame_id|. |
44 GURL GetUrl(int64 frame_id) const; | 45 GURL GetUrl(int64 frame_id) const; |
45 | 46 |
46 // True if the frame given by its |frame_id| is the main frame of its tab. | 47 // True if the frame given by its |frame_id| is the main frame of its tab. |
47 bool IsMainFrame(int64 frame_id) const; | 48 bool IsMainFrame(int64 frame_id) const; |
48 | 49 |
49 // Marks a frame as in an error state. | 50 // Marks a frame as in an error state. |
50 void ErrorOccurredInFrame(int64 frame_id); | 51 void ErrorOccurredInFrame(int64 frame_id); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Tracks the state of the frames we are sending events for. | 129 // Tracks the state of the frames we are sending events for. |
129 FrameNavigationState navigation_state_; | 130 FrameNavigationState navigation_state_; |
130 | 131 |
131 // Used for tracking registrations to navigation notifications. | 132 // Used for tracking registrations to navigation notifications. |
132 NotificationRegistrar registrar_; | 133 NotificationRegistrar registrar_; |
133 | 134 |
134 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); | 135 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); |
135 }; | 136 }; |
136 | 137 |
137 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 138 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
OLD | NEW |