1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 * @fileoverview Implements a compatibility layer for older versions of
10 goog.provide('google.cf.installer.InlineDelegate');
12 goog.require('goog.style');
14 goog.require('google.cf.installer.InteractionDelegate');
15 goog.require('google.cf.installer.frame');
18 * Adds an unadorned iframe into the page, taking arguments to customize it.
19 * @param {Object} args A map of user-specified properties to set
21 * @implements {google.cf.installer.InteractionDelegate}
23 google.cf.installer.InlineDelegate = function(args) {
25 this.args_.className = 'chromeFrameInstallDefaultStyle ' +
26 (this.args_.className || '');
30 * Indicates whether the overlay CSS has already been injected.
34 google.cf.installer.InlineDelegate.styleInjected_ = false;
37 * Generates the CSS for the overlay.
40 google.cf.installer.InlineDelegate.injectCss_ = function() {
41 if (google.cf.installer.InlineDelegate.styleInjected_)
44 goog.style.installStyles('.chromeFrameInstallDefaultStyle {' +
47 'position: absolute;' +
50 'margin-left: -400px;' +
51 'margin-top: -300px;' +
53 google.cf.installer.InlineDelegate.styleInjected_ = true;
59 google.cf.installer.InlineDelegate.prototype.getIFrameContainer = function() {
60 // TODO(user): This will append to the end of the container, whereas
61 // prior behaviour was beginning...
62 google.cf.installer.InlineDelegate.injectCss_();
63 return google.cf.installer.frame.getParentNode(this.args_);
69 google.cf.installer.InlineDelegate.prototype.customizeIFrame =
71 google.cf.installer.frame.setProperties(iframe, this.args_);
77 google.cf.installer.InlineDelegate.prototype.show = function() {
78 // TODO(user): Should start it out hidden and reveal/resize here.
84 google.cf.installer.InlineDelegate.prototype.reset =
86 // TODO(user): Should hide it here.