~robru/unity-firefox-extension/quantal-sru-candidate

« back to all changes in this revision

Viewing changes to unity-firefox-extension/content/unity-popup-manager.js

  • Committer: Ken VanDine
  • Author(s): Michael Terry
  • Date: 2012-09-20 18:27:41 UTC
  • mfrom: (83.37.52)
  • Revision ID: ken.vandine@canonical.com-20120920182741-xdk72p2ui1ahn7xx
Tags: 2.3.2-0ubuntu1
* New upstream release
  - Fixes buggy test
  - Fixes xid ctype
* Rename source package to match upstream
* debian/tests:
  - Run test suite as a dep8 test (because it needs mozmill via pip)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Components.utils.import("resource://gre/modules/PopupNotifications.jsm");
 
1
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
2
var Cu = Components.utils;
 
3
var Ci = Components.interfaces;
 
4
var Cc = Components.classes;
 
5
var Cr = Components.results;
2
6
 
3
 
var cofImageURI = "chrome://unity/skin.cof.png";
 
7
Cu.import("resource://gre/modules/PopupNotifications.jsm");
 
8
Cu.import("resource://unity/l10n.js");
4
9
 
5
10
UnityPopupManager = function (mainWindow) {
6
11
    this.mainWindow = mainWindow;
7
12
}
8
13
 
9
14
UnityPopupManager.prototype.requestIntegration = function (document, name, domain, integrateCallback, dontAskActionCallback) {
10
 
    var message = name + " ("+domain+") wants to integrate with Ubuntu";
11
 
    
 
15
    var message = l10n.formatMessage('prompt.message', [name, domain]);
 
16
 
12
17
    return this.mainWindow.PopupNotifications.show(this.mainWindow.gBrowser.getBrowserForDocument(document),
13
 
                                                   "unity-permission-popup", 
 
18
                                                   "unity-permission-popup",
14
19
                                                   message,
15
20
                                                   null,
16
 
                                                   {
17
 
                                                       label: "Integrate",
18
 
                                                       accessKey: "I",
19
 
                                                       callback: integrateCallback
20
 
                                                   },
 
21
                                                   { label: l10n.formatMessage('prompt.yes'),
 
22
                                                     accessKey: "Y",
 
23
                                                     callback: integrateCallback },
21
24
                                                   [
22
 
                                                       {
23
 
                                                           label: "Don't ask again",
24
 
                                                           accessKey: "D",
25
 
                                                           callback: dontAskActionCallback
26
 
                                                       }
 
25
                                                       { label: l10n.formatMessage('prompt.no'),
 
26
                                                         accessKey: "N",
 
27
                                                         callback: new Function() },
 
28
 
 
29
                                                       { label: l10n.formatMessage('prompt.dontask'),
 
30
                                                         accessKey: "D",
 
31
                                                         callback: dontAskActionCallback }
27
32
                                                   ]);
28
33
 
29
 
                                                           
 
34
 
30
35
}
31
36
 
32
37
var EXPORTED_SYMBOLS = ["UnityPopupManager"];
33
 
 
34