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

Side by Side Diff: components/sync/driver/resources/sync_index.js

Issue 2872023002: [Sync] Add a simple UI to sync-internals to create UserEvents. (Closed)
Patch Set: Updates for Patrick. Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Allow platform specific CSS rules. 5 // Allow platform specific CSS rules.
6 // 6 //
7 // TODO(akalin): BMM and options page does something similar, too. 7 // TODO(akalin): BMM and options page does something similar, too.
8 // Move this to util.js. 8 // Move this to util.js.
9 if (cr.isWindows) 9 if (cr.isWindows)
10 document.documentElement.setAttribute('os', 'win'); 10 document.documentElement.setAttribute('os', 'win');
11 11
12 cr.ui.decorate('tabbox', cr.ui.TabBox); 12 cr.ui.decorate('tabbox', cr.ui.TabBox);
13
14 cr.define('chrome.sync.index', function() {
15 function setUserEventsTabVisibility(visible) {
16 var display = visible ? 'block' : 'none';
17 document.getElementById('sync-user-events-tab').style.display = display;
Dan Beam 2017/05/16 03:35:52 can you just use .hidden = true/value instead?
skym 2017/05/16 19:26:49 I'm still learning how these things work, so I mig
Dan Beam 2017/05/22 22:15:49 add this rule somewhere in .css or in a <style> in
skym 2017/05/22 22:55:46 Huh, that's pretty clever. Thanks for the informat
18 }
19
20 function onLoad() {
21 chrome.sync.userEventsVisibilityCallback = setUserEventsTabVisibility;
22 chrome.sync.requestUserEventsVisibility();
23 }
24
25 return {
26 onLoad: onLoad
27 };
28 });
29
30 document.addEventListener('DOMContentLoaded', chrome.sync.index.onLoad, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698