1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 * @param {Element} container Content container.
9 function ErrorBanner(container) {
10 this.container_ = container;
11 this.errorBanner_ = this.container_.querySelector('.error-banner');
15 * Shows an error message.
16 * @param {string} message Message.
18 ErrorBanner.prototype.show = function(message) {
19 this.errorBanner_.textContent = str(message);
20 this.container_.setAttribute('error', true);
24 * Hides an error message.
26 ErrorBanner.prototype.clear = function() {
27 this.container_.removeAttribute('error');