Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4999)

Unified Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 313001: Implement the Extension History API, v 0.1.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/test/data/extensions/api_test/history/a.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extension_process_bindings.js
===================================================================
--- chrome/renderer/resources/extension_process_bindings.js (revision 30450)
+++ chrome/renderer/resources/extension_process_bindings.js (working copy)
@@ -234,8 +234,12 @@
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) {
@@ -418,4 +422,24 @@
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
+ };
})();
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/test/data/extensions/api_test/history/a.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698