| OLD | NEW |
| 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.res.Resources; | 8 import android.content.res.Resources; |
| 9 import android.os.Build; | 9 import android.os.Build; |
| 10 import android.text.Html; | 10 import android.text.Html; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 mIndeterminateColor = colorToHexValue(ApiCompatibilityUtils.getColor(res
ources, | 55 mIndeterminateColor = colorToHexValue(ApiCompatibilityUtils.getColor(res
ources, |
| 56 R.color.physical_web_diags_indeterminate_color)); | 56 R.color.physical_web_diags_indeterminate_color)); |
| 57 | 57 |
| 58 LayoutInflater inflater = LayoutInflater.from(activity); | 58 LayoutInflater inflater = LayoutInflater.from(activity); |
| 59 mPageView = inflater.inflate(R.layout.physical_web_diagnostics, null); | 59 mPageView = inflater.inflate(R.layout.physical_web_diagnostics, null); |
| 60 | 60 |
| 61 mLaunchButton = (Button) mPageView.findViewById(R.id.physical_web_launch
); | 61 mLaunchButton = (Button) mPageView.findViewById(R.id.physical_web_launch
); |
| 62 mLaunchButton.setOnClickListener(new View.OnClickListener() { | 62 mLaunchButton.setOnClickListener(new View.OnClickListener() { |
| 63 @Override | 63 @Override |
| 64 public void onClick(View v) { | 64 public void onClick(View v) { |
| 65 PhysicalWebUma.onActivityReferral(ListUrlsActivity.DIAGNOSTICS_R
EFERER); | 65 PhysicalWebUma.onActivityReferral(PhysicalWebUma.DIAGNOSTICS_REF
ERER); |
| 66 PhysicalWeb.showUrlList(); | 66 PhysicalWeb.showUrlList(); |
| 67 } | 67 } |
| 68 }); | 68 }); |
| 69 | 69 |
| 70 mDiagnosticsText = (TextView) mPageView.findViewById(R.id.physical_web_d
iagnostics_text); | 70 mDiagnosticsText = (TextView) mPageView.findViewById(R.id.physical_web_d
iagnostics_text); |
| 71 mDiagnosticsText.setAutoLinkMask(Linkify.WEB_URLS); | 71 mDiagnosticsText.setAutoLinkMask(Linkify.WEB_URLS); |
| 72 mDiagnosticsText.setText(Html.fromHtml(createDiagnosticsReportHtml())); | 72 mDiagnosticsText.setText(Html.fromHtml(createDiagnosticsReportHtml())); |
| 73 } | 73 } |
| 74 | 74 |
| 75 @Override | 75 @Override |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 private boolean isSdkVersionCorrect() { | 216 private boolean isSdkVersionCorrect() { |
| 217 return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT); | 217 return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT); |
| 218 } | 218 } |
| 219 | 219 |
| 220 private static String colorToHexValue(int color) { | 220 private static String colorToHexValue(int color) { |
| 221 return "#" + Integer.toHexString(color & 0x00ffffff); | 221 return "#" + Integer.toHexString(color & 0x00ffffff); |
| 222 } | 222 } |
| 223 } | 223 } |
| OLD | NEW |