function $LocationProvider(){
  var hashPrefix = '',
      html5Mode = false;

  /**
   * @ngdoc property
   * @name angular.module.ng.$locationProvider#hashPrefix
   * @methodOf angular.module.ng.$locationProvider
   * @description
   * @param {string=} prefix Prefix for hash part (containing path and search)
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */
  this.hashPrefix = function(prefix) {
    if (isDefined(prefix)) {
      hashPrefix = prefix;
      return this;
    } else {
      return hashPrefix;
    }
  }

  /**
   * @ngdoc property
   * @name angular.module.ng.$locationProvider#html5Mode
   * @methodOf angular.module.ng.$locationProvider
   * @description
   * @param {string=} mode Use HTML5 strategy if available.
   * @returns {*} current value if used as getter or itself (chaining) if used as setter
   */
  this.html5Mode = function(mode) {
    if (isDefined(mode)) {
      html5Mode = mode;
      return this;
    } else {
      return html5Mode;
    }
  };

  this.$get = ['$rootScope', '$browser', '$sniffer', '$document',
      function( $rootScope,   $browser,   $sniffer,   $document) {
    var currentUrl,
        basePath = $browser.baseHref() || '/',
        pathPrefix = pathPrefixFromBase(basePath),
        initUrl = $browser.url();

    if (html5Mode) {
      if ($sniffer.history) {
        currentUrl = new LocationUrl(convertToHtml5Url(initUrl, basePath, hashPrefix), pathPrefix);
      } else {
        currentUrl = new LocationHashbangUrl(convertToHashbangUrl(initUrl, basePath, hashPrefix),
                                             hashPrefix);
      }

      // link rewriting
      var u = currentUrl,
          absUrlPrefix = composeProtocolHostPort(u.protocol(), u.host(), u.port()) + pathPrefix;

      $document.bind('click', function(event) {
        // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
        // currently we open nice url link and redirect then

        if (event.ctrlKey || event.metaKey || event.which == 2) return;

        var elm = jqLite(event.target);

        // traverse the DOM up to find first A tag
        while (elm.length && lowercase(elm[0].nodeName) !== 'a') {
          elm = elm.parent();
        }

        var href = elm.attr('href');
        if (!href || isDefined(elm.attr('ng-ext-link')) || elm.attr('target')) return;

        // remove same domain from full url links (IE7 always returns full hrefs)
        href = href.replace(absUrlPrefix, '');

        // link to different domain (or base path)
        if (href.substr(0, 4) == 'http') return;

        // remove pathPrefix from absolute links
        href = href.indexOf(pathPrefix) === 0 ? href.substr(pathPrefix.length) : href;

        currentUrl.url(href);
        $rootScope.$apply();
        event.preventDefault();
        // hack to work around FF6 bug 684208 when scenario runner clicks on links
        window.angular['ff-684208-preventDefault'] = true;
      });
    } else {
      currentUrl = new LocationHashbangUrl(initUrl, hashPrefix);
    }

    // rewrite hashbang url <> html5 url
    if (currentUrl.absUrl() != initUrl) {
      $browser.url(currentUrl.absUrl(), true);
    }

    // update $location when $browser url changes
    $browser.onUrlChange(function(newUrl) {
      if (currentUrl.absUrl() != newUrl) {
        $rootScope.$evalAsync(function() {
          currentUrl.$$parse(newUrl);
        });
        if (!$rootScope.$$phase) $rootScope.$digest();
      }
    });

    // update browser
    var changeCounter = 0;
    $rootScope.$watch(function $locationWatch() {
      if ($browser.url() != currentUrl.absUrl()) {
        changeCounter++;
        $rootScope.$evalAsync(function() {
          $browser.url(currentUrl.absUrl(), currentUrl.$$replace);
          currentUrl.$$replace = false;
        });
      }

      return changeCounter;
    });

    return currentUrl;
}];
}
@ngdoc object
@name angular.module.ng.$locationProvider
@description
Use the `$locationProvider` to configure how the application deep linking paths are stored.