1////////////////////////////////////////////////////////////////////////////////
2//
3//  ADOBE SYSTEMS INCORPORATED
4//  Copyright 2007 Adobe Systems Incorporated
5//  All Rights Reserved.
6//
7//  NOTICE: Adobe permits you to use, modify, and distribute this file
8//  in accordance with the terms of the license agreement accompanying it.
9//
10////////////////////////////////////////////////////////////////////////////////
11
12package mx.managers
13{
14
15import mx.core.Singleton;
16
17/**
18 *  The BrowserManager is a Singleton manager that acts as
19 *  a proxy between the browser and the application.
20 *  It provides access to the URL in the browser address
21 *  bar similar to accessing the <code>document.location</code> property in JavaScript.
22 *  Events are dispatched when the <code>url</code> property is changed.
23 *  Listeners can then respond, alter the URL, and/or block others
24 *  from getting the event.
25 *
26 *  <p>To use the BrowserManager, you call the <code>getInstance()</code> method to get the current
27 *  instance of the manager, and call methods and listen to
28 *  events on that manager. See the IBrowserManager class for the
29 *  methods, properties, and events to use.</p>
30 *
31 *  @see mx.managers.IBrowserManager
32 *  @see mx.managers.HistoryManager
33 *
34 *  @langversion 3.0
35 *  @playerversion Flash 9
36 *  @playerversion AIR 1.1
37 *  @productversion Flex 3
38 */
39public class BrowserManager
40{
41    include "../core/Version.as";
42
43    //--------------------------------------------------------------------------
44    //
45    //  Class variables
46    //
47    //--------------------------------------------------------------------------
48
49    /**
50     *  @private
51     *  Linker dependency on implementation class.
52     */
53    private static var implClassDependency:BrowserManagerImpl;
54
55    /**
56     *  @private
57     */
58    private static var instance:IBrowserManager;
59
60    //--------------------------------------------------------------------------
61    //
62    //  Class methods
63    //
64    //--------------------------------------------------------------------------
65
66    /**
67     *  Returns the sole instance of this Singleton class;
68     *  creates it if it does not already exist.
69     *
70     *  @return Returns the sole instance of this Singleton class;
71     *  creates it if it does not already exist.
72     *
73     *  @langversion 3.0
74     *  @playerversion Flash 9
75     *  @playerversion AIR 1.1
76     *  @productversion Flex 3
77     */
78    public static function getInstance():IBrowserManager
79    {
80        if (!instance)
81        {
82            instance = IBrowserManager(
83                Singleton.getInstance("mx.managers::IBrowserManager"));
84        }
85
86        return instance;
87    }
88}
89
90}
91