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

Unified Diff: chrome/browser/resources/chromeos/arc_support/background.js

Issue 2449393002: Fix losing selected language on ToS page reloading. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/arc_support/background.js
diff --git a/chrome/browser/resources/chromeos/arc_support/background.js b/chrome/browser/resources/chromeos/arc_support/background.js
index 66500aff6973db38679efc0f4b5da9718a899c34..40adf3f1bf49612af93a75bf60e8c6d94760355e 100644
--- a/chrome/browser/resources/chromeos/arc_support/background.js
+++ b/chrome/browser/resources/chromeos/arc_support/background.js
@@ -484,7 +484,7 @@ function showPageWithStatus(pageId, status) {
showPage('terms');
return;
}
- loadInitialTerms();
+ loadTerms();
} else {
// Explicit request to start not from start page. Assume terms are
// accepted in this case.
@@ -499,10 +499,16 @@ function showPageWithStatus(pageId, status) {
}
/**
- * Loads initial Play Store terms.
+ * Loads Play Store terms.
*/
-function loadInitialTerms() {
- termsView.src = 'https://play.google.com/about/play-terms.html';
+function loadTerms() {
+ if (termsView.src) {
khmel 2016/10/26 20:35:20 This might be dangerous. Assume ToS decides to red
hidehiko 2016/10/27 04:01:48 I don't think the old code handles the case, becau
khmel 2016/10/27 14:40:57 Sorry, don't get what do you mean? Old code has si
hidehiko 2016/10/27 16:41:01 Sorry, I still am confused. "ToS decides to redir
+ // This is reloading the page, typically clicked RETRY on error page.
+ termsView.reload();
+ } else {
+ // This is first loading case so set the URL explicitly.
+ termsView.src = 'https://play.google.com/about/play-terms.html';
+ }
}
function setWindowBounds() {
@@ -665,7 +671,7 @@ chrome.app.runtime.onLaunched.addListener(function() {
// the ToS.
onAgree();
} else {
- loadInitialTerms();
+ loadTerms();
hidehiko 2016/10/26 13:33:54 Note: Typically, this is the reload case. However,
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698