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

Unified Diff: chrome/browser/resources/chromeos/slow.js

Issue 22654003: Create system tray item for accessing chrome://slow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/slow.js
diff --git a/chrome/browser/resources/chromeos/slow.js b/chrome/browser/resources/chromeos/slow.js
new file mode 100644
index 0000000000000000000000000000000000000000..e0e84bfc676f61892d9f71e90f10e0f6081716cf
--- /dev/null
+++ b/chrome/browser/resources/chromeos/slow.js
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 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.
+
+cr.define('options', function() {
+ function Slow() {
+ }
+ cr.addSingletonGetter(Slow);
+
+ Slow.prototype = {
+ initialized_: false
+ };
+
+ Slow.initialize = function() {
+ $('slow-disable').addEventListener('click', function(event) {
+ Slow.disableTracing();
+ });
+ $('slow-enable').addEventListener('click', function(event) {
+ Slow.enableTracing();
+ });
+ this.initialized_ = true;
+ };
+
+ Slow.disableTracing = function() {
+ chrome.send('disableTracing');
+ };
+
+ Slow.enableTracing = function() {
+ chrome.send('enableTracing');
+ };
+
+ Slow.tracingPrefChanged = function(enabled) {
+ $('slow-disable').hidden = !enabled;
+ $('slow-enable').hidden = enabled;
+ };
+
+ // Export
+ return {
+ Slow: Slow
+ };
+});
+
+function load() {
+ options.Slow.initialize();
+ chrome.send('loadComplete');
+}
+
+document.addEventListener('DOMContentLoaded', load);

Powered by Google App Engine
This is Rietveld 408576698