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

Unified Diff: chrome_frame/cfinstall/src/stub/frame.js

Issue 8467005: Publish the source for CFInstall.min.js . (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Line length fixes. Created 9 years, 1 month 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
Index: chrome_frame/cfinstall/src/stub/frame.js
diff --git a/chrome_frame/cfinstall/src/stub/frame.js b/chrome_frame/cfinstall/src/stub/frame.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d239846f50e0a8f3b5fb1f5f1c74f538991062c
--- /dev/null
+++ b/chrome_frame/cfinstall/src/stub/frame.js
@@ -0,0 +1,46 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Implements some utilities for the legacy 'inline' and 'overlay'
+ * UI modes.
+ **/
+
+goog.provide('google.cf.installer.frame');
+
+/**
+ * Plucks properties from the passed arguments and sets them on the passed
+ * DOM node
+ * @param {Node} node The node to set properties on
+ * @param {Object} args A map of user-specified properties to set
+ */
+google.cf.installer.frame.setProperties = function(node, args) {
+ var cssText = args['cssText'] || '';
+ node.style.cssText = ' ' + cssText;
+
+ var classText = args['className'] || '';
+ node.className = classText;
+
+ var srcNode = args['node'];
+ if (typeof srcNode == 'string')
+ srcNode = document.getElementById(srcNode);
+ return args['id'] || (srcNode ? srcNode['id'] || '' : '');
+};
+
+/**
+ * Determines the parent node to create the IFrame in, based on the provided
+ * arguments. Note that this should only be called once.
+ * @param {Object} args A map of user-specified properties.
+ */
+google.cf.installer.frame.getParentNode = function(args) {
+ var srcNode = args['node'];
+ if (typeof srcNode == 'string')
+ srcNode = document.getElementById(srcNode);
+ if (srcNode) {
+ var parentNode = srcNode.parentNode;
+ parentNode.removeChild(srcNode);
+ return parentNode;
+ }
+ return document.body;
+};

Powered by Google App Engine
This is Rietveld 408576698