B2G/gecko/browser/components/nsBrowserGlue.js
/**
   * Show the notificationBox for a locked places database.
   */
Show the notificationBox for a locked places database.
Show the notificationBox for a locked places database .
function BG__showPlacesLockedNotificationBox() {
    var brandBundle  = Services.strings.createBundle("chrome://branding/locale/brand.properties");
    var applicationName = brandBundle.GetStringFromName("brandShortName");
    var placesBundle = Services.strings.createBundle("chrome://browser/locale/places/places.properties");
    var title = placesBundle.GetStringFromName("lockPrompt.title");
    var text = placesBundle.formatStringFromName("lockPrompt.text", [applicationName], 1);
    var buttonText = placesBundle.GetStringFromName("lockPromptInfoButton.label");
    var accessKey = placesBundle.GetStringFromName("lockPromptInfoButton.accessKey");
    var helpTopic = "places-locked";
    var url = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
              getService(Components.interfaces.nsIURLFormatter).
              formatURLPref("app.support.baseURL");
    url += helpTopic;
    var browser = this.getMostRecentBrowserWindow().gBrowser;
    var buttons = [
                    {
                      label:     buttonText,
                      accessKey: accessKey,
                      popup:     null,
                      callback:  function(aNotificationBar, aButton) {
                        browser.selectedTab = browser.addTab(url);
                      }
                    }
                  ];
    var notifyBox = browser.getNotificationBox();
    var notification = notifyBox.appendNotification(text, title, null,
                                                    notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                                    buttons);
    notification.persistence = -1; 
  }
function BG__showPlacesLockedNotificationBox ( ) { var brandBundle = Services . strings . createBundle ( "chrome://branding/locale/brand.properties" ) ; var applicationName = brandBundle . GetStringFromName ( "brandShortName" ) ; var placesBundle = Services . strings . createBundle ( "chrome://browser/locale/places/places.properties" ) ; var title = placesBundle . GetStringFromName ( "lockPrompt.title" ) ; var text = placesBundle . formatStringFromName ( "lockPrompt.text" , [ applicationName ] , 1 ) ; var buttonText = placesBundle . GetStringFromName ( "lockPromptInfoButton.label" ) ; var accessKey = placesBundle . GetStringFromName ( "lockPromptInfoButton.accessKey" ) ; var helpTopic = "places-locked" ; var url = Cc [ "@mozilla.org/toolkit/URLFormatterService;1" ] . getService ( Components . interfaces . nsIURLFormatter ) . formatURLPref ( "app.support.baseURL" ) ; url += helpTopic ; var browser = this . getMostRecentBrowserWindow ( ) . gBrowser ; var buttons = [ { label : buttonText , accessKey : accessKey , popup : null , callback : function ( aNotificationBar , aButton ) { browser . selectedTab = browser . addTab ( url ) ; } } ] ; var notifyBox = browser . getNotificationBox ( ) ; var notification = notifyBox . appendNotification ( text , title , null , notifyBox . PRIORITY_CRITICAL_MEDIUM , buttons ) ; notification . persistence = - 1 ; }
Show the notificationBox for a locked places database.
Show the notificationBox for a locked places database .
// Until user closes it