diff options
author | brg@chromium.com <brg@chromium.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 05:25:01 +0000 |
---|---|---|
committer | brg@chromium.com <brg@chromium.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-30 05:25:01 +0000 |
commit | de768a837346f2f78fbc5368bdf1d0c8e37c8f10 (patch) | |
tree | af9fadc824793d3f9fef771ac312e1e371ee5ded /chrome/renderer | |
parent | d4e58f35f5d7091aa3ba483e1c02b454b6bfd3f2 (diff) | |
download | chromium_src-de768a837346f2f78fbc5368bdf1d0c8e37c8f10.zip chromium_src-de768a837346f2f78fbc5368bdf1d0c8e37c8f10.tar.gz chromium_src-de768a837346f2f78fbc5368bdf1d0c8e37c8f10.tar.bz2 |
Implement the Extension History API, v 0.1.The first version is a weak wrapper around the HistoryServices object in Chrome.BUG=22952TEST=browser_tests.exe --gtest_filer=ExtensionApiTest.History
Review URL: http://codereview.chromium.org/313001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/resources/extension_process_bindings.js | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js index dc4044b..3d3fb88 100644 --- a/chrome/renderer/resources/extension_process_bindings.js +++ b/chrome/renderer/resources/extension_process_bindings.js @@ -238,8 +238,12 @@ var chrome = chrome || {}; var apiDefinitions = JSON.parse(GetExtensionAPIDefinition()); apiDefinitions.forEach(function(apiDef) { - chrome[apiDef.namespace] = chrome[apiDef.namespace] || {}; - var module = chrome[apiDef.namespace]; + var module = chrome; + var namespaces = apiDef.namespace.split('.'); + for (var index = 0, name; name = namespaces[index]; index++) { + module[name] = module[name] || {}; + module = module[name]; + }; // Add types to global validationTypes if (apiDef.types) { @@ -422,4 +426,24 @@ var chrome = chrome || {}; setupPageActionEvents(extensionId); setupToolstripEvents(GetRenderViewId()); }); + + if (!chrome.experimental) + chrome.experimental = {}; + + if (!chrome.experimental.history) + chrome.experimental.history = {}; + + chrome.experimental.history.transistionType = { + LINK: 0, + TYPED: 1, + AUTO_BOOKMARK: 2, + AUTO_SUBFRAME: 3, + MANUAL_SUBFRAME: 4, + GENERATED: 5, + START_PAGE: 6, + FORM_SUBMIT: 7, + RELOAD: 8, + KEYWORD: 9, + KEYWORD_GENERATED: 10 + }; })(); |