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 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class RenderViewHost; | 15 class RenderViewHost; |
16 } | 16 } |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 // Tracks the navigation state of all frames in a given tab currently known to | 20 // Tracks the navigation state of all frames in a given tab currently known to |
21 // the webNavigation API. It is mainly used to track in which frames an error | 21 // the webNavigation API. It is mainly used to track in which frames an error |
22 // occurred so no further events for this frame are being sent. | 22 // occurred so no further events for this frame are being sent. |
23 class FrameNavigationState { | 23 class FrameNavigationState { |
24 public: | 24 public: |
25 // A frame is uniquely identified by its frame ID and the RVH it's in. | 25 // A frame is uniquely identified by its frame ID and the RVH it's in. |
26 struct FrameID { | 26 struct FrameID { |
27 FrameID(); | 27 FrameID(); |
28 FrameID(int64 frame_num, content::RenderViewHost* render_view_host); | 28 FrameID(int64 frame_num, content::RenderViewHost* render_view_host); |
29 | 29 |
30 bool IsValid() const; | |
31 | |
32 bool operator<(const FrameID& other) const; | 30 bool operator<(const FrameID& other) const; |
33 bool operator==(const FrameID& other) const; | 31 bool operator==(const FrameID& other) const; |
34 bool operator!=(const FrameID& other) const; | 32 bool operator!=(const FrameID& other) const; |
35 | 33 |
36 int64 frame_num; | 34 int64 frame_num; |
37 content::RenderViewHost* render_view_host; | 35 content::RenderViewHost* render_view_host; |
38 }; | 36 }; |
39 typedef std::set<FrameID>::const_iterator const_iterator; | 37 typedef std::set<FrameID>::const_iterator const_iterator; |
40 | 38 |
41 FrameNavigationState(); | 39 FrameNavigationState(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 137 |
140 // If true, also allow events from chrome-extension:// URLs. | 138 // If true, also allow events from chrome-extension:// URLs. |
141 static bool allow_extension_scheme_; | 139 static bool allow_extension_scheme_; |
142 | 140 |
143 DISALLOW_COPY_AND_ASSIGN(FrameNavigationState); | 141 DISALLOW_COPY_AND_ASSIGN(FrameNavigationState); |
144 }; | 142 }; |
145 | 143 |
146 } // namespace extensions | 144 } // namespace extensions |
147 | 145 |
148 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H
_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_FRAME_NAVIGATION_STATE_H
_ |
OLD | NEW |