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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java

Issue 2418403003: Enable the "Browse the Physical Web" button only when Physical Web is ON. (Closed)
Patch Set: Addressed review comments 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.physicalweb; 5 package org.chromium.chrome.browser.physicalweb;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.content.res.Resources; 9 import android.content.res.Resources;
10 import android.os.Build; 10 import android.os.Build;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 boolean isOnboarding = PhysicalWeb.isOnboarding(); 128 boolean isOnboarding = PhysicalWeb.isOnboarding();
129 129
130 int prerequisitesResult = Utils.RESULT_SUCCESS; 130 int prerequisitesResult = Utils.RESULT_SUCCESS;
131 if (!isSdkVersionCorrect 131 if (!isSdkVersionCorrect
132 || !isDataConnectionActive 132 || !isDataConnectionActive
133 || bluetoothStatus == Utils.RESULT_FAILURE 133 || bluetoothStatus == Utils.RESULT_FAILURE
134 || !isLocationServicesEnabled 134 || !isLocationServicesEnabled
135 || !isLocationPermissionGranted 135 || !isLocationPermissionGranted
136 || !isPreferenceEnabled) { 136 || !isPreferenceEnabled) {
137 prerequisitesResult = Utils.RESULT_FAILURE; 137 prerequisitesResult = Utils.RESULT_FAILURE;
138 mLaunchButton.setEnabled(false);
138 } else if (bluetoothStatus == Utils.RESULT_INDETERMINATE) { 139 } else if (bluetoothStatus == Utils.RESULT_INDETERMINATE) {
139 prerequisitesResult = Utils.RESULT_INDETERMINATE; 140 prerequisitesResult = Utils.RESULT_INDETERMINATE;
141 mLaunchButton.setEnabled(false);
140 } 142 }
141 143
142 sb.append("<h2>Status</h2>"); 144 sb.append("<h2>Status</h2>");
143 145
144 sb.append("Physical Web is "); 146 sb.append("Physical Web is ");
145 appendResult(sb, prerequisitesResult != Utils.RESULT_FAILURE, "ON", "OFF "); 147 appendResult(sb, prerequisitesResult != Utils.RESULT_FAILURE, "ON", "OFF ");
146 148
147 sb.append("<h2>Prerequisites</h2>"); 149 sb.append("<h2>Prerequisites</h2>");
148 150
149 sb.append("Android SDK version: "); 151 sb.append("Android SDK version: ");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 219
218 private static Intent createListUrlsIntent() { 220 private static Intent createListUrlsIntent() {
219 return new Intent(ContextUtils.getApplicationContext(), ListUrlsActivity .class) 221 return new Intent(ContextUtils.getApplicationContext(), ListUrlsActivity .class)
220 .putExtra(ListUrlsActivity.REFERER_KEY, ListUrlsActivity.DIAGNOS TICS_REFERER); 222 .putExtra(ListUrlsActivity.REFERER_KEY, ListUrlsActivity.DIAGNOS TICS_REFERER);
221 } 223 }
222 224
223 private static String colorToHexValue(int color) { 225 private static String colorToHexValue(int color) {
224 return "#" + Integer.toHexString(color & 0x00ffffff); 226 return "#" + Integer.toHexString(color & 0x00ffffff);
225 } 227 }
226 } 228 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698