summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/chrome_v8_context.cc
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 04:09:23 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-21 04:09:23 +0000
commit46babb29a2e0f45d940a3197c74ddfa3b7abb7bf (patch)
tree59aa719c22084d760027e0b38d9d4d668342dda6 /chrome/renderer/extensions/chrome_v8_context.cc
parentcd2c46e818a21cef01ccdf7c13bf3577d228e894 (diff)
downloadchromium_src-46babb29a2e0f45d940a3197c74ddfa3b7abb7bf.zip
chromium_src-46babb29a2e0f45d940a3197c74ddfa3b7abb7bf.tar.gz
chromium_src-46babb29a2e0f45d940a3197c74ddfa3b7abb7bf.tar.bz2
Convert app_bindings.js to the schema_generated_bindings.js infrastructure.
This involves opening up *all* custom bindings to web pages, where access is controlled content-script style using a URL-matches property in the API schema. BUG=104100,117282 TEST=unit_tests,browser_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125811 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=127391 Review URL: http://codereview.chromium.org/9460002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/chrome_v8_context.cc')
-rw-r--r--chrome/renderer/extensions/chrome_v8_context.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc
index 7db10ed..6d59a19 100644
--- a/chrome/renderer/extensions/chrome_v8_context.cc
+++ b/chrome/renderer/extensions/chrome_v8_context.cc
@@ -15,6 +15,8 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "v8/include/v8.h"
+using extensions::Feature;
+
namespace {
const char kChromeHidden[] = "chromeHidden";
@@ -24,11 +26,13 @@ const char kValidateCallbacks[] = "validateCallbacks";
const char kValidateAPI[] = "validateAPI";
#endif
-std::string GetContextTypeDescription(
- ChromeV8Context::ContextType context_type) {
+std::string GetContextTypeDescription(Feature::Context context_type) {
switch (context_type) {
- case ChromeV8Context::OTHER: return "other";
- case ChromeV8Context::CONTENT_SCRIPT: return "content script";
+ case Feature::UNSPECIFIED_CONTEXT: return "unspecified";
+ case Feature::PRIVILEGED_CONTEXT: return "privileged";
+ case Feature::UNPRIVILEGED_CONTEXT: return "unprivileged";
+ case Feature::CONTENT_SCRIPT_CONTEXT: return "content script";
+ case Feature::WEB_PAGE_CONTEXT: return "web page";
}
NOTREACHED();
return "";
@@ -39,7 +43,7 @@ std::string GetContextTypeDescription(
ChromeV8Context::ChromeV8Context(v8::Handle<v8::Context> v8_context,
WebKit::WebFrame* web_frame,
const std::string& extension_id,
- ChromeV8Context::ContextType context_type)
+ Feature::Context context_type)
: v8_context_(v8::Persistent<v8::Context>::New(v8_context)),
web_frame_(web_frame),
extension_id_(extension_id),