forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add chrome://nfc-debug for debugging NFC on Chrome OS.
Wrote a simple WebUI page that demonstrates the functionality of the NFC API defined in device/nfc. This is primarily meant for testing and demo purposes. BUG=336687 Review URL: https://codereview.chromium.org/131103007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247118 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
armansito@chromium.org
committed
Jan 25, 2014
1 parent
1f58a75
commit f4660c6
Showing
13 changed files
with
1,468 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* Copyright 2014 The Chromium Authors. All rights reserved. | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
body { | ||
margin: 0 | ||
} | ||
|
||
p { | ||
white-space: pre-wrap; | ||
} | ||
|
||
label { | ||
display: block; | ||
} | ||
|
||
h1 { | ||
margin: 1%; | ||
} | ||
|
||
div.entity-div { | ||
-webkit-box-shadow: 0 0 20px 2px #aaa; | ||
box-shadow: 0 0 20px 2px #aaa; | ||
display: inline-block; | ||
margin: 10px 5px; | ||
overflow: hidden; | ||
padding: 10px; | ||
vertical-align: top; | ||
} | ||
|
||
#nfc-adapter-info { | ||
width: 165px; | ||
} | ||
|
||
#ndef-record-form { | ||
width: 300px; | ||
} | ||
|
||
#nfc-tag-info, | ||
#nfc-peer-info { | ||
width: 270px; | ||
word-wrap: break-word; | ||
} | ||
|
||
#ndef-record-form input { | ||
width: 99%; | ||
} | ||
|
||
.parameters-table td { | ||
padding: 0 10px 10px 0; | ||
} | ||
|
||
.transition-in { | ||
-webkit-transition: opacity 250ms ease-in-out; | ||
opacity: 1; | ||
transition: opacity 250ms ease-in-out; | ||
} | ||
|
||
.transition-out { | ||
-webkit-transition: opacity 250ms ease-in-out; | ||
opacity: 0.25; | ||
transition: opacity 250ms ease-in-out; | ||
} | ||
|
||
hr { | ||
background: #888; | ||
border: 0; | ||
border-bottom: 1px dashed #ccc; | ||
} | ||
|
||
div.record-key-value-div { | ||
margin-bottom: 10px; | ||
} | ||
|
||
span.record-key-span, | ||
div.record-key-div { | ||
font-style: italic; | ||
font-weight: bold; | ||
margin-right: 10px; | ||
} | ||
|
||
.record-value-div > * { | ||
margin: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<!DOCTYPE html> | ||
<html i18n-values="dir:textdirection;"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title i18n-content="titleText"></title> | ||
<link rel="stylesheet" type="text/css" href="nfc_debug.css"> | ||
<script src="chrome://resources/js/cr.js"></script> | ||
<script src="chrome://resources/js/load_time_data.js"></script> | ||
<script src="chrome://resources/js/util.js"></script> | ||
<script src="strings.js"></script> | ||
<script src="nfc_debug.js"></script> | ||
</head> | ||
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> | ||
<h1 i18n-content="titleText"></h1> | ||
<p id="nfc-not-supported" i18n-content="notSupportedText"></p> | ||
<div id="wrapper"> | ||
<div id="nfc-adapter-info" class="entity-div"> | ||
<h3 i18n-content="adapterHeaderText"></h3> | ||
<div id="adapter-parameters"></div> | ||
<div id="adapter-toggles"> | ||
<button id="power-toggle"></button> | ||
<button id="poll-toggle"></button> | ||
</div> | ||
</div> | ||
<div id="ndef-record-form" class="entity-div"> | ||
<h3 i18n-content="ndefFormHeaderText"></h3> | ||
<select id="record-type-menu"> | ||
<option i18n-content="ndefFormTypeTextText" value="text"></option> | ||
<option i18n-content="ndefFormTypeUriText" value="uri"></option> | ||
<option i18n-content="ndefFormTypeSmartPosterText" value="smart-poster"> | ||
</option> | ||
</select> | ||
<div id="text-form" class="record-form"> | ||
<div> | ||
<label for="text-form-text" class="required" | ||
i18n-content="ndefFormFieldTextText"> | ||
</label> | ||
<input type="text" id="text-form-text"> | ||
</div> | ||
<div> | ||
<label for="text-form-encoding" class="required" | ||
i18n-content="ndefFormFieldEncodingText"> | ||
</label> | ||
<input type="text" id="text-form-encoding"> | ||
</div> | ||
<div> | ||
<label for="text-form-language-code" class="required" | ||
i18n-content="ndefFormFieldLanguageCodeText"> | ||
</label> | ||
<input type="text" id="text-form-language-code"> | ||
</div> | ||
</div> | ||
<div id="uri-form" class="record-form"> | ||
<div> | ||
<label for="uri-form-uri" class="required" | ||
i18n-content="ndefFormFieldUriText"></label> | ||
<input type="text" id="uri-form-uri"> | ||
</div> | ||
<div> | ||
<label for="uri-form-mime-type" | ||
i18n-content="ndefFormFieldMimeTypeText"></label> | ||
<input type="text" id="uri-form-mime-type"> | ||
</div> | ||
<div> | ||
<label for="uri-form-target-size" | ||
i18n-content="ndefFormFieldTargetSizeText"></label> | ||
<input type="text" id="uri-form-target-size"> | ||
</div> | ||
</div> | ||
<div id="smart-poster-form" class="record-form"> | ||
<div> | ||
<label for="smart-poster-form-uri" | ||
i18n-content="ndefFormFieldUriText"></label> | ||
<input type="text" id="smart-poster-form-uri"> | ||
</div> | ||
<div> | ||
<label for="smart-poster-form-mime-type" | ||
i18n-content="ndefFormFieldMimeTypeText"></label> | ||
<input type="text" id="smart-poster-form-mime-type"> | ||
</div> | ||
<div> | ||
<label for="smart-poster-form-target-size" | ||
i18n-content="ndefFormFieldTargetSizeText"></label> | ||
<input type="text" id="smart-poster-form-target-size"> | ||
</div> | ||
<div> | ||
<label for="smart-poster-form-title-text" | ||
i18n-content="ndefFormFieldTitleTextText"> | ||
</label> | ||
<input type="text" id="smart-poster-form-title-text"> | ||
</div> | ||
<div> | ||
<label for="smart-poster-form-title-encoding" | ||
i18n-content="ndefFormFieldTitleEncodingText"> | ||
</label> | ||
<input type="text" id="smart-poster-form-title-encoding"> | ||
</div> | ||
<div> | ||
<label for="smart-poster-form-title-language-code" | ||
i18n-content="ndefFormFieldTitleLanguageCodeText"> | ||
</label> | ||
<input type="text" id="smart-poster-form-title-language-code"> | ||
</div> | ||
</div> | ||
<button id="record-form-submit-button"></button> | ||
</div> | ||
<div id="nfc-peer-info" class="entity-div"> | ||
<h3 i18n-content="nfcPeerHeaderText"></h3> | ||
<div id="peer-parameters"></div> | ||
<div id="peer-records-entry" class="records-entry"> | ||
<h3 i18n-content="recordsHeaderText"></h3> | ||
<hr/> | ||
<div id="peer-records-container"></div> | ||
<hr/> | ||
</div> | ||
</div> | ||
<div id="nfc-tag-info" class="entity-div"> | ||
<h3 i18n-content="nfcTagHeaderText"></h3> | ||
<div id="tag-parameters"></div> | ||
<div id="tag-records-entry" class="records-entry"> | ||
<h3 i18n-content="recordsHeaderText"></h3> | ||
<hr/> | ||
<div id="tag-records-container"></div> | ||
<hr/> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="chrome://resources/js/i18n_template2.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.