cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / options / automatic_settings_reset_banner.js
blobe0747c58e15109a6f1399dfb33a5bd888b2741b7
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.
5 // Note: the native-side handler for this is AutomaticSettingsResetHandler.
7 cr.define('options', function() {
8 /** @const */ var SettingsBannerBase = options.SettingsBannerBase;
9 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
11 /**
12 * AutomaticSettingsResetBanner class
13 * Provides encapsulated handling of the Reset Profile Settings banner.
14 * @constructor
15 * @extends {options.SettingsBannerBase}
17 function AutomaticSettingsResetBanner() {}
19 cr.addSingletonGetter(AutomaticSettingsResetBanner);
21 AutomaticSettingsResetBanner.prototype = {
22 __proto__: SettingsBannerBase.prototype,
24 /**
25 * Initializes the banner's event handlers.
26 * @suppress {checkTypes}
27 * TODO(vitalyp): remove the suppression. Suppression is needed because
28 * method dismiss() is attached to AutomaticSettingsResetBanner at run-time
29 * via "Forward public APIs to protected implementations" pattern (see
30 * below). Currently the compiler pass and cr.js handles only forwarding to
31 * private implementations using cr.makePublic().
33 initialize: function() {
34 this.showMetricName = 'AutomaticSettingsReset_WebUIBanner_BannerShown';
36 this.dismissNativeCallbackName =
37 'onDismissedAutomaticSettingsResetBanner';
39 this.visibilityDomElement = $('automatic-settings-reset-banner');
41 $('automatic-settings-reset-banner-close').onclick = function(event) {
42 chrome.send('metricsHandler:recordAction',
43 ['AutomaticSettingsReset_WebUIBanner_ManuallyClosed']);
44 AutomaticSettingsResetBanner.dismiss();
46 $('automatic-settings-reset-learn-more').onclick = function(event) {
47 chrome.send('metricsHandler:recordAction',
48 ['AutomaticSettingsReset_WebUIBanner_LearnMoreClicked']);
50 $('automatic-settings-reset-banner-activate-reset').onclick =
51 function(event) {
52 chrome.send('metricsHandler:recordAction',
53 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']);
54 PageManager.showPageByName('resetProfileSettings');
59 // Forward public APIs to protected implementations.
61 'show',
62 'dismiss',
63 ].forEach(function(name) {
64 AutomaticSettingsResetBanner[name] = function() {
65 var instance = AutomaticSettingsResetBanner.getInstance();
66 return instance[name].apply(instance, arguments);
68 });
70 // Export
71 return {
72 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner
74 });