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.
chromeos: Material Design version of Set Time dialog, part 1
* Add SetTimeDialogMd feature flag. * Port the core functionality to Polymer. * Add test using mocha. TODO: Styling to spec will be done in follow-up CLs. BUG=927732 TEST=browser_tests SetTimeWebUITest, manual Change-Id: I32e283e0c3db86536a392108bce9aba162f6b836 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497494 Commit-Queue: James Cook <jamescook@chromium.org> Reviewed-by: Michael Giuffrida <michaelpg@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Cr-Commit-Position: refs/heads/master@{#641331}
- Loading branch information
James Cook
authored and
Commit Bot
committed
Mar 15, 2019
1 parent
4f0f0ee
commit f699d73
Showing
17 changed files
with
571 additions
and
8 deletions.
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
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,30 @@ | ||
# Copyright 2019 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. | ||
|
||
import("//third_party/closure_compiler/compile_js.gni") | ||
|
||
js_type_check("closure_compile") { | ||
deps = [ | ||
":set_time", | ||
":set_time_browser_proxy", | ||
] | ||
} | ||
|
||
js_library("set_time") { | ||
deps = [ | ||
":set_time_browser_proxy", | ||
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog", | ||
"//ui/webui/resources/js:assert", | ||
"//ui/webui/resources/js:cr", | ||
"//ui/webui/resources/js:load_time_data", | ||
"//ui/webui/resources/js:web_ui_listener_behavior", | ||
] | ||
} | ||
|
||
js_library("set_time_browser_proxy") { | ||
deps = [ | ||
"//ui/webui/resources/js:cr", | ||
] | ||
externs_list = [ "$externs_path/chrome_send.js" ] | ||
} |
98 changes: 98 additions & 0 deletions
98
chrome/browser/resources/chromeos/md_set_time/set_time.html
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,98 @@ | ||
<!doctype html> | ||
<html dir="$i18n{textdirection}" lang="$i18n{language}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>$i18n{setTimeTitle}</title> | ||
|
||
<link rel="import" href="chrome://resources/html/polymer.html"> | ||
|
||
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> | ||
<link rel="import" href="chrome://resources/cr_elements/paper_button_style_css.html"> | ||
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> | ||
<link rel="import" href="chrome://resources/html/load_time_data.html"> | ||
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> | ||
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> | ||
<link rel="import" href="set_time_browser_proxy.html"> | ||
|
||
<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> | ||
|
||
<script src="strings.js"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<dom-module id="set-time"> | ||
<template> | ||
<style include="cr-shared-style paper-button-style"> | ||
:host { | ||
@apply --cr-page-host; | ||
} | ||
|
||
cr-dialog { | ||
--cr-dialog-native: { | ||
border-radius: 0; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.row { | ||
margin: 0.65em 0; | ||
} | ||
|
||
input[type='date'], | ||
input[type='time'] { | ||
font-family: inherit; | ||
font-size: 16px; | ||
letter-spacing: 1px; | ||
margin-bottom: 4px; | ||
margin-inline-end: 8px; | ||
} | ||
|
||
input[type='date']::-webkit-clear-button, | ||
input[type='time']::-webkit-clear-button { | ||
display: none; | ||
} | ||
|
||
label { | ||
margin-inline-end: 5px; | ||
} | ||
|
||
#timezoneSelect { | ||
font-family: inherit; | ||
font-size: inherit; | ||
} | ||
</style> | ||
|
||
<cr-dialog id="dialog"> | ||
<div slot="title">$i18n{setTimeTitle}</div> | ||
<div slot="body" id="dialogBody"> | ||
<div class="row">$i18n{prompt}</div> | ||
|
||
<div> | ||
<input id="dateInput" type="date" title="$i18n{dateLabel}" | ||
on-blur="onTimeBlur_"> | ||
<input id="timeInput" type="time" title="$i18n{timeLabel}" | ||
on-blur="onTimeBlur_"> | ||
</div> | ||
|
||
<div id="timezone" class="row" hidden> | ||
<label for="timezoneSelect">$i18n{timezone}</label> | ||
<select id="timezoneSelect" on-change="onTimezoneChange_"></select> | ||
</div> | ||
</div> | ||
|
||
<div slot="button-container"> | ||
<paper-button class="action-button" on-click="onDoneClick_"> | ||
$i18n{doneButton} | ||
</paper-button> | ||
</div> | ||
</cr-dialog> | ||
</template> | ||
<script src="set_time.js"></script> | ||
</dom-module> | ||
|
||
<set-time></set-time> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.