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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js

Issue 2157713002: DevTools: introduce View: a named widget with the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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: third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js
deleted file mode 100644
index b8f3a13d429fc5221e77c0ca6584a58c3749c0ca..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// 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.
-
-/**
- * @constructor
- * @extends {WebInspector.Widget}
- * @param {boolean=} isWebComponent
- */
-WebInspector.ThrottledWidget = function(isWebComponent)
-{
- WebInspector.Widget.call(this, isWebComponent);
- this._updateThrottler = new WebInspector.Throttler(100);
- this._updateWhenVisible = false;
-}
-
-WebInspector.ThrottledWidget.prototype = {
- /**
- * @protected
- * @return {!Promise.<?>}
- */
- doUpdate: function()
- {
- return Promise.resolve();
- },
-
- update: function()
- {
- this._updateWhenVisible = !this.isShowing();
- if (this._updateWhenVisible)
- return;
- this._updateThrottler.schedule(innerUpdate.bind(this));
-
- /**
- * @this {WebInspector.ThrottledWidget}
- * @return {!Promise.<?>}
- */
- function innerUpdate()
- {
- if (this.isShowing()) {
- return this.doUpdate();
- } else {
- this._updateWhenVisible = true;
- return Promise.resolve();
- }
- }
- },
-
- /**
- * @override
- */
- wasShown: function()
- {
- WebInspector.Widget.prototype.wasShown.call(this);
- if (this._updateWhenVisible)
- this.update();
- },
-
- __proto__: WebInspector.Widget.prototype
-}

Powered by Google App Engine
This is Rietveld 408576698