Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: utils/pub/oauth2.dart

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/curl_client_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/oauth2.dart
diff --git a/utils/pub/oauth2.dart b/utils/pub/oauth2.dart
index 24d798afd60d75223937e6394a2d2d4e7dbee613..5066e6d6679370486b8c6a07d901f779599fa097 100644
--- a/utils/pub/oauth2.dart
+++ b/utils/pub/oauth2.dart
@@ -33,13 +33,13 @@ final _secret = 'SWeqj8seoJW0w7_CpEPFLX0K';
/// a refresh token from the server. See the [Google OAuth2 documentation][].
///
/// [Google OAuth2 documentation]: https://developers.google.com/accounts/docs/OAuth2WebServer#offline
-final _authorizationEndpoint = new Uri.fromString(
+final _authorizationEndpoint = Uri.parse(
'https://accounts.google.com/o/oauth2/auth?access_type=offline'
'&approval_prompt=force');
/// The URL from which the pub client will request an access token once it's
/// been authorized by the user.
-final _tokenEndpoint = new Uri.fromString(
+final _tokenEndpoint = Uri.parse(
'https://accounts.google.com/o/oauth2/token');
/// The OAuth2 scopes that the pub client needs. Currently the client only needs
@@ -159,7 +159,7 @@ Future<Client> _authorize() {
// Allow the tests to inject their own token endpoint URL.
var tokenEndpoint = Platform.environment['_PUB_TEST_TOKEN_ENDPOINT'];
if (tokenEndpoint != null) {
- tokenEndpoint = new Uri.fromString(tokenEndpoint);
+ tokenEndpoint = Uri.parse(tokenEndpoint);
} else {
tokenEndpoint = _tokenEndpoint;
}
@@ -194,7 +194,7 @@ Future<Client> _authorize() {
server.listen('127.0.0.1', 0);
var authUrl = grant.getAuthorizationUrl(
- new Uri.fromString('http://localhost:${server.port}'), scopes: _scopes);
+ Uri.parse('http://localhost:${server.port}'), scopes: _scopes);
log.message(
'Pub needs your authorization to upload packages on your behalf.\n'
« no previous file with comments | « utils/pub/io.dart ('k') | utils/tests/pub/curl_client_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698