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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.java

Issue 348433002: Verify the host-supplied URL matches the domain's allowed URL patterns (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Lambros' feedbacks Created 6 years, 6 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 | « no previous file | remoting/android/java/src/org/chromium/chromoting/HostInfo.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/Chromoting.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
index 42d66035fe4dbcada3c30bccd37a546daa22f329..1928f3c715913b6d67598c02f438856a6d67a039 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Chromoting.java
@@ -281,9 +281,12 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
@Override
public void onCancel(DialogInterface dialog) {
JniInterface.disconnectFromHost();
+ mTokenFetcher = null;
}
});
SessionConnector connector = new SessionConnector(this, this, mHostListLoader);
+ assert mTokenFetcher == null;
+ mTokenFetcher = createTokenFetcher(host);
connector.connectToHost(mAccount.name, mToken, host);
}
@@ -459,9 +462,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
}
}
- public void fetchThirdPartyToken(String tokenUrl, String clientId, String scope) {
- assert mTokenFetcher == null;
-
+ private ThirdPartyTokenFetcher createTokenFetcher(HostInfo host) {
ThirdPartyTokenFetcher.Callback callback = new ThirdPartyTokenFetcher.Callback() {
public void onTokenFetched(String code, String accessToken) {
// The native client sends the OAuth authorization code to the host as the token so
@@ -476,10 +477,11 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
JniInterface.nativeOnThirdPartyTokenFetched(token, sharedSecret);
}
};
-
- mTokenFetcher = new ThirdPartyTokenFetcher(this, tokenUrl, clientId, scope, callback);
- mTokenFetcher.fetchToken();
+ return new ThirdPartyTokenFetcher(this, host.getTokenUrlPatterns(), callback);
}
-
+ public void fetchThirdPartyToken(String tokenUrl, String clientId, String scope) {
+ assert mTokenFetcher != null;
+ mTokenFetcher.fetchToken(tokenUrl, clientId, scope);
+ }
}
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/HostInfo.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698