File: services.js

package info (click to toggle)
conkeror 0.9.2%2Bgit100804-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,680 kB
  • ctags: 1,182
  • sloc: sh: 547; ansic: 272; xml: 107; makefile: 79
file content (30 lines) | stat: -rw-r--r-- 994 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * (C) Copyright 2010 John J. Foerch
 *
 * Use, modification, and distribution are subject to the terms specified in the
 * COPYING file.
**/

/**
 * Be sparing about adding service variables to this file.  Only add
 * services for which it makes sense to keep a global reference because
 * they are used in numerous separate places in Conkeror.  In most cases,
 * a simple `let' form around the function or two that use a service is
 * best, because it keeps all the code in one place.
 */

in_module(null);

const file_locator_service = Cc["@mozilla.org/file/directory_service;1"]
    .getService(Ci.nsIProperties);

const nav_bookmarks_service = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]
    .getService(Ci.nsINavBookmarksService);

const nav_history_service = Cc["@mozilla.org/browser/nav-history-service;1"]
    .getService(Ci.nsINavHistoryService);

const observer_service = Cc["@mozilla.org/observer-service;1"]
    .getService(Ci.nsIObserverService);

provide("services");