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.
9 goog.provide('google.cf.installer.Installer');
11 goog.require('google.cf.ChromeFrame');
12 goog.require('google.cf.installer.Prompt');
17 google.cf.installer.Installer = function(prompt, chromeFrame) {
18 this.prompt_ = prompt;
19 this.chromeFrame_ = chromeFrame;
22 google.cf.installer.Installer.prototype.require =
23 function(opt_onInstall, opt_onFailure) {
24 if (this.chromeFrame_.isActiveRenderer())
27 if (!this.chromeFrame_.isPlatformSupported()) {
33 var successHandler = opt_onInstall || function() {
34 window.location.assign(window.location.href);
37 if (this.chromeFrame_.activate()) {
42 this.prompt_.open(successHandler, opt_onFailure);