blob: 3a23a4f74e11c10d93bbc647b066605cdf6ff7a4 [file] [log] [blame]
// 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.
/**
* @param {Element} container Content container.
* @constructor
*/
function ErrorBanner(container) {
this.container_ = container;
this.errorBanner_ = this.container_.querySelector('.error-banner');
}
/**
* Shows an error message.
* @param {string} message Message.
*/
ErrorBanner.prototype.show = function(message) {
this.errorBanner_.textContent = str(message);
this.container_.setAttribute('error', true);
};
/**
* Hides an error message.
*/
ErrorBanner.prototype.clear = function() {
this.container_.removeAttribute('error');
};