[Sync] Add a simple UI to sync-internals to create UserEvents.
Very simple UI and plumbing to create UserEvents from
chrome://sync-internals. Since there are not currently any defined
event types, we cannot do anything interesting. Currently expose text
fields to specify int64 event time and navigation time. Invalid
navigation time will result in meaningless event. Tab should be hidden
if the feature is not enabled (disabled is the default).
BUG=719044
Review-Url: https://codereview.chromium.org/2872023002
Cr-Commit-Position: refs/heads/master@{#474814}
Committed: https://chromium.googlesource.com/chromium/src/+/6c146620037bf6c1222d5a0255be9a6ef2ce5137
Description was changed from ========== [Sync] Add a simple UI to sync-internals to create UserEvents. ...
3 years, 7 months ago
(2017-05-09 23:28:06 UTC)
#3
Description was changed from
==========
[Sync] Add a simple UI to sync-internals to create UserEvents.
BUG=719044
==========
to
==========
[Sync] Add a simple UI to sync-internals to create UserEvents.
Very simple UI and plumbing to create UserEvents from
chrome://sync-internals. Since there are not currently any defined
event types, we cannot do anything interesting. Currently expose text
fields to specify int64 event time and navigation time. Invalid
navigation time will result in meaningless event. Tab should be hidden
if the feature is not enabled (disabled is the default).
BUG=719044
==========
Updates for Patrick. https://codereview.chromium.org/2872023002/diff/20001/chrome/browser/ui/webui/sync_internals_message_handler.cc File chrome/browser/ui/webui/sync_internals_message_handler.cc (right): https://codereview.chromium.org/2872023002/diff/20001/chrome/browser/ui/webui/sync_internals_message_handler.cc#newcode45 chrome/browser/ui/webui/sync_internals_message_handler.cc:45: int64_t IndexToInt64(const base::ListValue* list, int index) ...
3 years, 7 months ago
(2017-05-10 00:06:46 UTC)
#7
Updates for Patrick.
https://codereview.chromium.org/2872023002/diff/20001/chrome/browser/ui/webui...
File chrome/browser/ui/webui/sync_internals_message_handler.cc (right):
https://codereview.chromium.org/2872023002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/sync_internals_message_handler.cc:45: int64_t
IndexToInt64(const base::ListValue* list, int index) {
On 2017/05/09 23:46:23, Patrick Noland wrote:
> From the name I'd expect this to convert an index, not the value in the list
at
> the index. Maybe something like StringAtIndexToInt64?
Done.
https://codereview.chromium.org/2872023002/diff/20001/chrome/browser/ui/webui...
chrome/browser/ui/webui/sync_internals_message_handler.cc:53: return 0;
On 2017/05/09 23:46:23, Patrick Noland wrote:
> So if you fat-finger one of the inputs the value will just silently default to
> 0. Are you sure that's what you want? I'm not sure how much validation there
is
> for UserEvents, but I know that e.g. ChromeHistory protos won't be written at
> the server level if their timestamp falls outside of an acceptable window.
I think feedback in the UI that they've entered a value that doesn't convert
nicely to an int would be a great improvement, but I think we should improve
iteratively, seem reasonable?
https://codereview.chromium.org/2872023002/diff/20001/components/sync/driver/...
File components/sync/driver/resources/user_events.js (right):
https://codereview.chromium.org/2872023002/diff/20001/components/sync/driver/...
components/sync/driver/resources/user_events.js:8:
document.getElementById('event-time-usec-input').value,
On 2017/05/09 23:46:23, Patrick Noland wrote:
> What happens if either of these fields has whitespace?
"" => 0
" " => 0
" 123 " => 0
"12 3" => 0
"123" => 123
Patrick Noland
lgtm
3 years, 7 months ago
(2017-05-10 00:08:14 UTC)
#8
lgtm
skym
Friendly ping dbeam@
3 years, 7 months ago
(2017-05-12 18:45:18 UTC)
#9
Friendly ping dbeam@
skym
The CQ bit was checked by skym@chromium.org to run a CQ dry run
3 years, 7 months ago
(2017-05-15 18:34:19 UTC)
#10
3 years, 7 months ago
(2017-05-15 20:47:13 UTC)
#13
Dry run: This issue passed the CQ dry run.
Dan Beam
https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui/sync_internals_message_handler.cc File chrome/browser/ui/webui/sync_internals_message_handler.cc (right): https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui/sync_internals_message_handler.cc#newcode205 chrome/browser/ui/webui/sync_internals_message_handler.cc:205: web_ui()->CallJavascriptFunctionUnsafe( can we use the safe version instead? https://codereview.chromium.org/2872023002/diff/40001/components/resources/sync_driver_resources.grdp ...
3 years, 7 months ago
(2017-05-16 03:35:52 UTC)
#14
Updates for dbeam@ https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui/sync_internals_message_handler.cc File chrome/browser/ui/webui/sync_internals_message_handler.cc (right): https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui/sync_internals_message_handler.cc#newcode205 chrome/browser/ui/webui/sync_internals_message_handler.cc:205: web_ui()->CallJavascriptFunctionUnsafe( On 2017/05/16 03:35:51, Dan Beam ...
3 years, 7 months ago
(2017-05-16 19:26:49 UTC)
#19
Updates for dbeam@
https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui...
File chrome/browser/ui/webui/sync_internals_message_handler.cc (right):
https://codereview.chromium.org/2872023002/diff/40001/chrome/browser/ui/webui...
chrome/browser/ui/webui/sync_internals_message_handler.cc:205:
web_ui()->CallJavascriptFunctionUnsafe(
On 2017/05/16 03:35:51, Dan Beam wrote:
> can we use the safe version instead?
Done. And switched all the other invocations in this file to
content::WebUIMessageHandler::CallJavascriptFunction(), but now I need to call
AllowJavascript() at some point.
So I put AllowJavascript() into the start of every HandleX method. Is this
reasonable? It seems to be the way most people deal with this
https://cs.chromium.org/search/?q=%22+AllowJavascript();%22&type=cs , but does
it defeat the purpose of calling the safe version?
Maybe it would be more elegant if I had a single DOMContentLoaded listener that
called up the the message handler telling me that the page has finished loading,
but, we have a whole bunch of independent DOMContentLoaded listeners on this
page,
https://cs.chromium.org/search/?q=DOMContentLoaded+file:%5Esrc/components/syn...
Should I try to consolidate these into a single on ui ready call? It seems kind
of nice that everything is modular and independent right now, although which
DOMContentLoaded listener gets called first seems very unclear.
https://codereview.chromium.org/2872023002/diff/40001/components/resources/sy...
File components/resources/sync_driver_resources.grdp (right):
https://codereview.chromium.org/2872023002/diff/40001/components/resources/sy...
components/resources/sync_driver_resources.grdp:14: <include
name="IDR_SYNC_DRIVER_SYNC_INTERNALS_USER_EVENTS_JS"
file="../sync/driver/resources/user_events.js" type="BINDATA" />
On 2017/05/16 03:35:51, Dan Beam wrote:
> can you remove the double space before file=? it seems the copy pasta will
> continue otherwise
Done. Updated the others as well.
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
File components/sync/driver/resources/sync_index.js (right):
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
components/sync/driver/resources/sync_index.js:17:
document.getElementById('sync-user-events-tab').style.display = display;
On 2017/05/16 03:35:52, Dan Beam wrote:
> can you just use .hidden = true/value instead?
I'm still learning how these things work, so I might be overlooking something
obvious. My interpretation of your comment is that you wanted me to add
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
However, this attribute seems to get overriden by the CSS display property,
which we currently inherit from
https://cs.chromium.org/chromium/src/ui/webui/resources/css/tabs.css?l=38
display: block; seems to significantly change the visual look, so even if I
removed the display property when hidden was applied, I would also need to add
it back when I removed the hidden attribute, which means this code cannot be
simplified.
This page doesn't seem to be the only consumer of tabs.css, so removing the
display property from the style rule seems dangerous.
https://cs.chromium.org/search/?q=chrome://resources/css/tabs.css&type=cs
I tried copying what was done in
https://chromiumcodereview.appspot.com/15894032/ but I'm not sure what I was
really expecting, it just adds more stuff, the display: block; property still
gets through.
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
File components/sync/driver/resources/user_events.js (right):
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
components/sync/driver/resources/user_events.js:8:
document.getElementById('event-time-usec-input').value,
On 2017/05/16 03:35:52, Dan Beam wrote:
> can you just use $('event-time-usec-input') instead of
> document.getElementById()?
Done. Changed sync_index.js's usage of document.getElementById as well.
Can you explain to me what's going on with this $('id') syntax? Googling for
this functionality is seems kind of like jquery but it doesn't contain a '#'.
Have we defined this lookup mechanism ourselves within our internal Chrome web
ui somewhere?
Also, why exactly is the $('id') version superior to the
document.getElementById('id') approach? Just because it's shorter and consistent
with the rest of the code? Or does it actually do something different?
I'm realizing some other .js files in this folder setup dependencies like
// require: cr.js
// require: cr/ui.js
// require: cr/ui/tree.js
I'm having a very difficult time figuring out code prompts the cr.js dependency.
Should I be doing any of this in user_events.js or sync_index.js?
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
3 years, 7 months ago
(2017-05-16 22:06:22 UTC)
#20
More updates for dbeam, split out some refactoring of SyncInternalsMessageHandler into https://codereview.chromium.org/2898723003/ , which simplifies ...
3 years, 7 months ago
(2017-05-22 21:55:48 UTC)
#26
3 years, 7 months ago
(2017-05-22 22:15:49 UTC)
#29
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
File components/sync/driver/resources/sync_index.js (right):
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
components/sync/driver/resources/sync_index.js:17:
document.getElementById('sync-user-events-tab').style.display = display;
On 2017/05/16 19:26:49, skym wrote:
> On 2017/05/16 03:35:52, Dan Beam wrote:
> > can you just use .hidden = true/value instead?
>
> I'm still learning how these things work, so I might be overlooking something
> obvious. My interpretation of your comment is that you wanted me to add
> https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
>
> However, this attribute seems to get overriden by the CSS display property,
> which we currently inherit from
> https://cs.chromium.org/chromium/src/ui/webui/resources/css/tabs.css?l=38
>
> display: block; seems to significantly change the visual look, so even if I
> removed the display property when hidden was applied, I would also need to add
> it back when I removed the hidden attribute, which means this code cannot be
> simplified.
>
> This page doesn't seem to be the only consumer of tabs.css, so removing the
> display property from the style rule seems dangerous.
> https://cs.chromium.org/search/?q=chrome://resources/css/tabs.css&type=cs
>
> I tried copying what was done in
> https://chromiumcodereview.appspot.com/15894032/ but I'm not sure what I was
> really expecting, it just adds more stuff, the display: block; property still
> gets through.
add this rule somewhere in .css or in a <style> in your .html. pretty much
everywhere does this. the spec on [hidden] was kinda poorly thought out.
[hidden] {
display: none !important;
}
skym
The CQ bit was checked by skym@chromium.org to run a CQ dry run
3 years, 7 months ago
(2017-05-22 22:55:44 UTC)
#30
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/resources/sync_index.js File components/sync/driver/resources/sync_index.js (right): https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/resources/sync_index.js#newcode17 components/sync/driver/resources/sync_index.js:17: document.getElementById('sync-user-events-tab').style.display = display; On 2017/05/22 22:15:49, Dan Beam wrote: ...
3 years, 7 months ago
(2017-05-22 22:55:46 UTC)
#31
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
File components/sync/driver/resources/sync_index.js (right):
https://codereview.chromium.org/2872023002/diff/40001/components/sync/driver/...
components/sync/driver/resources/sync_index.js:17:
document.getElementById('sync-user-events-tab').style.display = display;
On 2017/05/22 22:15:49, Dan Beam wrote:
> On 2017/05/16 19:26:49, skym wrote:
> > On 2017/05/16 03:35:52, Dan Beam wrote:
> > > can you just use .hidden = true/value instead?
> >
> > I'm still learning how these things work, so I might be overlooking
something
> > obvious. My interpretation of your comment is that you wanted me to add
> > https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
> >
> > However, this attribute seems to get overriden by the CSS display property,
> > which we currently inherit from
> > https://cs.chromium.org/chromium/src/ui/webui/resources/css/tabs.css?l=38
> >
> > display: block; seems to significantly change the visual look, so even if I
> > removed the display property when hidden was applied, I would also need to
add
> > it back when I removed the hidden attribute, which means this code cannot be
> > simplified.
> >
> > This page doesn't seem to be the only consumer of tabs.css, so removing the
> > display property from the style rule seems dangerous.
> > https://cs.chromium.org/search/?q=chrome://resources/css/tabs.css&type=cs
> >
> > I tried copying what was done in
> > https://chromiumcodereview.appspot.com/15894032/ but I'm not sure what I was
> > really expecting, it just adds more stuff, the display: block; property
still
> > gets through.
>
> add this rule somewhere in .css or in a <style> in your .html. pretty much
> everywhere does this. the spec on [hidden] was kinda poorly thought out.
>
> [hidden] {
> display: none !important;
> }
Huh, that's pretty clever. Thanks for the information! Done.
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2872023002/140001
3 years, 7 months ago
(2017-05-22 22:56:13 UTC)
#32
lgtm i'll make sure to keep looking at your dependent patchset, though https://codereview.chromium.org/2872023002/diff/140001/components/sync/driver/resources/chrome_sync.js File components/sync/driver/resources/chrome_sync.js ...
3 years, 7 months ago
(2017-05-22 23:44:47 UTC)
#33
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/433546)
3 years, 7 months ago
(2017-05-23 00:55:48 UTC)
#35
On 2017/05/23 11:16:58, jochen wrote: > would it make sense to make //components/sync/OWNERS also own ...
3 years, 7 months ago
(2017-05-24 00:20:06 UTC)
#38
On 2017/05/23 11:16:58, jochen wrote:
> would it make sense to make //components/sync/OWNERS also own
> //components/resource/sync_driver_resources.grdp?
Done.
skym
Updates for dbeam and jochen. https://codereview.chromium.org/2872023002/diff/140001/components/sync/driver/resources/chrome_sync.js File components/sync/driver/resources/chrome_sync.js (right): https://codereview.chromium.org/2872023002/diff/140001/components/sync/driver/resources/chrome_sync.js#newcode88 components/sync/driver/resources/chrome_sync.js:88: * Sends data to ...
3 years, 7 months ago
(2017-05-24 00:20:25 UTC)
#39
CQ is committing da patch. Bot data: {"patchset_id": 220001, "attempt_start_ts": 1495742291924740, "parent_rev": "e96185d01c286ffb9892e3f7dff6765bea1dc81b", "commit_rev": "6c146620037bf6c1222d5a0255be9a6ef2ce5137"}
3 years, 7 months ago
(2017-05-25 21:39:08 UTC)
#47
CQ is committing da patch.
Bot data: {"patchset_id": 220001, "attempt_start_ts": 1495742291924740,
"parent_rev": "e96185d01c286ffb9892e3f7dff6765bea1dc81b", "commit_rev":
"6c146620037bf6c1222d5a0255be9a6ef2ce5137"}
commit-bot: I haz the power
Description was changed from ========== [Sync] Add a simple UI to sync-internals to create UserEvents. ...
3 years, 7 months ago
(2017-05-25 21:39:21 UTC)
#48
Message was sent while issue was closed.
Description was changed from
==========
[Sync] Add a simple UI to sync-internals to create UserEvents.
Very simple UI and plumbing to create UserEvents from
chrome://sync-internals. Since there are not currently any defined
event types, we cannot do anything interesting. Currently expose text
fields to specify int64 event time and navigation time. Invalid
navigation time will result in meaningless event. Tab should be hidden
if the feature is not enabled (disabled is the default).
BUG=719044
==========
to
==========
[Sync] Add a simple UI to sync-internals to create UserEvents.
Very simple UI and plumbing to create UserEvents from
chrome://sync-internals. Since there are not currently any defined
event types, we cannot do anything interesting. Currently expose text
fields to specify int64 event time and navigation time. Invalid
navigation time will result in meaningless event. Tab should be hidden
if the feature is not enabled (disabled is the default).
BUG=719044
Review-Url: https://codereview.chromium.org/2872023002
Cr-Commit-Position: refs/heads/master@{#474814}
Committed:
https://chromium.googlesource.com/chromium/src/+/6c146620037bf6c1222d5a0255be...
==========
commit-bot: I haz the power
Committed patchset #12 (id:220001) as https://chromium.googlesource.com/chromium/src/+/6c146620037bf6c1222d5a0255be9a6ef2ce5137
3 years, 7 months ago
(2017-05-25 21:39:23 UTC)
#49
Issue 2872023002: [Sync] Add a simple UI to sync-internals to create UserEvents.
(Closed)
Created 3 years, 7 months ago by skym
Modified 3 years, 7 months ago
Reviewers: jochen (gone - plz use gerrit), Dan Beam, Patrick Noland
Base URL:
Comments: 34