Index: chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
index 3b04125a35373f2826840b85c5a3914624cbc65d..427f398a54af4d9e332803d6580b3c09a89ae92b 100644 |
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api_helpers.cc |
@@ -19,6 +19,7 @@ |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
#include "extensions/browser/event_router.h" |
+#include "extensions/browser/extension_api_frame_id_map.h" |
#include "extensions/common/event_filtering_info.h" |
#include "net/base/net_errors.h" |
#include "ui/base/page_transition_types.h" |
@@ -60,15 +61,10 @@ void DispatchEvent(content::BrowserContext* browser_context, |
} // namespace |
int GetFrameId(content::RenderFrameHost* frame_host) { |
- if (!frame_host) |
- return -1; |
- return !frame_host->GetParent() ? 0 : frame_host->GetRoutingID(); |
+ return ExtensionApiFrameIdMap::Get()->GetFrameId(frame_host).frame_id; |
} |
// Constructs and dispatches an onBeforeNavigate event. |
-// TODO(dcheng): Is the parent process ID needed here? http://crbug.com/393640 |
-// Collisions are probably possible... but maybe this won't ever happen because |
-// of the SiteInstance grouping policies. |
void DispatchOnBeforeNavigate(content::WebContents* web_contents, |
content::RenderFrameHost* frame_host, |
const GURL& validated_url) { |