Refactor: cleanup declarative_api.cc and get rid of
commitb684c7ada5434b1954cced5e13a9d91ba88de6cd
authorhanxi <hanxi@chromium.org>
Thu, 18 Dec 2014 16:18:50 +0000 (18 08:18 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Dec 2014 16:19:16 +0000 (18 16:19 +0000)
treef2342b9ca757bf226b8ff41f69327e66e3f7c61c
parentc232cd2fe905d1b751dd8dd2527e5144f151ce9f
Refactor: cleanup declarative_api.cc and get rid of
"webViewIntanal" prefix when passing declarative webRequest
Event from <webview>.

When <webview> call an API, the event
that passes to the browser will keep its original name.
For example, "declarativeWebRequest.onMessage".
With this patch, we don't need to add the "webViewIntanal"
prefix when creating an event, and remove the prefix when
browser receive it.

However, this would cause a problem: you cannot tell
whether this event comes from <webview> or regular tabs
simply from its name. So the event will be treated as a
regular API event rather than a <webview> event, and fails
when doing feature permission checks if <webview> calls
declarativeWebRequest API from a chrome app.

In this CL, web_view_instance_id is passed along during
event registry to bypass the feature permission checks.

BUG=437566

Review URL: https://codereview.chromium.org/794803002

Cr-Commit-Position: refs/heads/master@{#309017}
extensions/browser/api/declarative/declarative_api.cc
extensions/renderer/resources/guest_view/web_view_events.js