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

Side by Side Diff: chrome/renderer/resources/extensions/automation_custom_bindings.js

Issue 273323002: Convert snakecase enum names to camelcase when stringified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final changes Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom bindings for the automation API. 5 // Custom bindings for the automation API.
6 var automation = require('binding').Binding.create('automation'); 6 var automation = require('binding').Binding.create('automation');
7 var automationInternal = 7 var automationInternal =
8 require('binding').Binding.create('automationInternal').generate(); 8 require('binding').Binding.create('automationInternal').generate();
9 var eventBindings = require('event_bindings'); 9 var eventBindings = require('event_bindings');
10 var Event = eventBindings.Event; 10 var Event = eventBindings.Event;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 var targetTree = idToAutomationTree[id]; 78 var targetTree = idToAutomationTree[id];
79 if (!targetTree) { 79 if (!targetTree) {
80 // If this is the first time we've gotten data for this tree, it will 80 // If this is the first time we've gotten data for this tree, it will
81 // contain all of the tree's data, so create a new tree which will be 81 // contain all of the tree's data, so create a new tree which will be
82 // bootstrapped from |data|. 82 // bootstrapped from |data|.
83 targetTree = new AutomationTree(pid, rid); 83 targetTree = new AutomationTree(pid, rid);
84 idToAutomationTree[id] = targetTree; 84 idToAutomationTree[id] = targetTree;
85 } 85 }
86 privates(targetTree).impl.update(data); 86 privates(targetTree).impl.update(data);
87 var eventType = data.eventType; 87 var eventType = data.eventType;
88 if (eventType == 'load_complete' || eventType == 'layout_complete') { 88 if (eventType == 'loadComplete' || eventType == 'layoutComplete') {
89 // If the tree wasn't available when getTree() was called, the callback will 89 // If the tree wasn't available when getTree() was called, the callback will
90 // have been cached in idToCallback, so call and delete it now that we 90 // have been cached in idToCallback, so call and delete it now that we
91 // have the complete tree. 91 // have the complete tree.
92 if (id in idToCallback) { 92 if (id in idToCallback) {
93 for (var i = 0; i < idToCallback[id].length; i++) { 93 for (var i = 0; i < idToCallback[id].length; i++) {
94 var callback = idToCallback[id][i]; 94 var callback = idToCallback[id][i];
95 callback(targetTree); 95 callback(targetTree);
96 } 96 }
97 delete idToCallback[id]; 97 delete idToCallback[id];
98 } 98 }
99 } 99 }
100 }); 100 });
101 101
102 exports.binding = automation.generate(); 102 exports.binding = automation.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698