Rename new Uri.fromString to Uri.parse.

Review URL: https://codereview.chromium.org//12052038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17562 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/oauth2.dart b/lib/oauth2.dart
index cc0bb99..4dfaadd 100644
--- a/lib/oauth2.dart
+++ b/lib/oauth2.dart
@@ -28,9 +28,9 @@
 ///     // server. They're usually included in the server's documentation of its
 ///     // OAuth2 API.
 ///     final authorizationEndpoint =
-///         new Uri.fromString("http://example.com/oauth2/authorization");
+///         Uri.parse("http://example.com/oauth2/authorization");
 ///     final tokenEndpoint =
-///         new Uri.fromString("http://example.com/oauth2/token");
+///         Uri.parse("http://example.com/oauth2/token");
 ///     
 ///     // The authorization server will issue each client a separate client
 ///     // identifier and secret, which allows the server to tell which client
@@ -48,7 +48,7 @@
 ///     // will redirect the resource owner here once they've authorized the
 ///     // client. The redirection will include the authorization code in the
 ///     // query parameters.
-///     final redirectUrl = new Uri.fromString(
+///     final redirectUrl = Uri.parse(
 ///         "http://my-site.com/oauth2-redirect");
 ///     
 ///     var credentialsFile = new File("~/.myapp/credentials.json");
diff --git a/lib/src/authorization_code_grant.dart b/lib/src/authorization_code_grant.dart
index abd0d2e..b361f21 100644
--- a/lib/src/authorization_code_grant.dart
+++ b/lib/src/authorization_code_grant.dart
@@ -185,7 +185,7 @@
       if (parameters.containsKey('error')) {
         var description = parameters['error_description'];
         var uriString = parameters['error_uri'];
-        var uri = uriString == null ? null : new Uri.fromString(uriString);
+        var uri = uriString == null ? null : Uri.parse(uriString);
         throw new AuthorizationException(parameters['error'], description, uri);
       } else if (!parameters.containsKey('code')) {
         throw new FormatException('Invalid OAuth response for '
diff --git a/lib/src/credentials.dart b/lib/src/credentials.dart
index d476e78..17cd410 100644
--- a/lib/src/credentials.dart
+++ b/lib/src/credentials.dart
@@ -105,7 +105,7 @@
 
     var tokenEndpoint = parsed['tokenEndpoint'];
     if (tokenEndpoint != null) {
-      tokenEndpoint = new Uri.fromString(tokenEndpoint);
+      tokenEndpoint = Uri.parse(tokenEndpoint);
     }
     var expiration = parsed['expiration'];
     if (expiration != null) {
diff --git a/lib/src/handle_access_token_response.dart b/lib/src/handle_access_token_response.dart
index d1fedea..6443247 100644
--- a/lib/src/handle_access_token_response.dart
+++ b/lib/src/handle_access_token_response.dart
@@ -130,7 +130,7 @@
 
   var description = parameters['error_description'];
   var uriString = parameters['error_uri'];
-  var uri = uriString == null ? null : new Uri.fromString(uriString);
+  var uri = uriString == null ? null : Uri.parse(uriString);
   throw new AuthorizationException(parameters['error'], description, uri);
 }
 
diff --git a/test/authorization_code_grant_test.dart b/test/authorization_code_grant_test.dart
index 7614bcd..0bc3433 100644
--- a/test/authorization_code_grant_test.dart
+++ b/test/authorization_code_grant_test.dart
@@ -15,7 +15,7 @@
 import '../lib/oauth2.dart' as oauth2;
 import 'utils.dart';
 
-final redirectUrl = new Uri.fromString('http://example.com/redirect');
+final redirectUrl = Uri.parse('http://example.com/redirect');
 
 ExpectClient client;
 
@@ -26,8 +26,8 @@
   grant = new oauth2.AuthorizationCodeGrant(
       'identifier',
       'secret',
-      new Uri.fromString('https://example.com/authorization'),
-      new Uri.fromString('https://example.com/token'),
+      Uri.parse('https://example.com/authorization'),
+      Uri.parse('https://example.com/token'),
       httpClient: client);
 }
 
@@ -75,8 +75,8 @@
       grant = new oauth2.AuthorizationCodeGrant(
           'identifier',
           'secret',
-          new Uri.fromString('https://example.com/authorization?query=value'),
-          new Uri.fromString('https://example.com/token'),
+          Uri.parse('https://example.com/authorization?query=value'),
+          Uri.parse('https://example.com/token'),
           httpClient: client);
 
       var authorizationUrl = grant.getAuthorizationUrl(redirectUrl);
diff --git a/test/client_test.dart b/test/client_test.dart
index fd5e5b4..b875de9 100644
--- a/test/client_test.dart
+++ b/test/client_test.dart
@@ -14,9 +14,9 @@
 import '../lib/oauth2.dart' as oauth2;
 import 'utils.dart';
 
-final Uri requestUri = new Uri.fromString("http://example.com/resource");
+final Uri requestUri = Uri.parse("http://example.com/resource");
 
-final Uri tokenEndpoint = new Uri.fromString('http://example.com/token');
+final Uri tokenEndpoint = Uri.parse('http://example.com/token');
 
 ExpectClient httpClient;
 
diff --git a/test/credentials_test.dart b/test/credentials_test.dart
index e3f24da..e6ad2a9 100644
--- a/test/credentials_test.dart
+++ b/test/credentials_test.dart
@@ -14,7 +14,7 @@
 import '../lib/oauth2.dart' as oauth2;
 import 'utils.dart';
 
-final Uri tokenEndpoint = new Uri.fromString('http://example.com/token');
+final Uri tokenEndpoint = Uri.parse('http://example.com/token');
 
 ExpectClient httpClient;
 
diff --git a/test/handle_access_token_response_test.dart b/test/handle_access_token_response_test.dart
index 6bfb7da..3e95ddc 100644
--- a/test/handle_access_token_response_test.dart
+++ b/test/handle_access_token_response_test.dart
@@ -14,7 +14,7 @@
 import '../lib/src/handle_access_token_response.dart';
 import 'utils.dart';
 
-final Uri tokenEndpoint = new Uri.fromString("https://example.com/token");
+final Uri tokenEndpoint = Uri.parse("https://example.com/token");
 
 final DateTime startTime = new DateTime.now();