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

Side by Side Diff: chrome/browser/resources/options/automatic_settings_reset_banner.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ugh just no Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Note: the native-side handler for this is AutomaticSettingsResetHandler. 5 // Note: the native-side handler for this is AutomaticSettingsResetHandler.
6 6
7 cr.define('options', function() { 7 cr.define('options', function() {
8 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; 8 /** @const */ var SettingsBannerBase = options.SettingsBannerBase;
9 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
9 10
10 /** 11 /**
11 * AutomaticSettingsResetBanner class 12 * AutomaticSettingsResetBanner class
12 * Provides encapsulated handling of the Reset Profile Settings banner. 13 * Provides encapsulated handling of the Reset Profile Settings banner.
13 * @constructor 14 * @constructor
14 */ 15 */
15 function AutomaticSettingsResetBanner() {} 16 function AutomaticSettingsResetBanner() {}
16 17
17 cr.addSingletonGetter(AutomaticSettingsResetBanner); 18 cr.addSingletonGetter(AutomaticSettingsResetBanner);
18 19
(...skipping 17 matching lines...) Expand all
36 AutomaticSettingsResetBanner.dismiss(); 37 AutomaticSettingsResetBanner.dismiss();
37 }; 38 };
38 $('automatic-settings-reset-learn-more').onclick = function(event) { 39 $('automatic-settings-reset-learn-more').onclick = function(event) {
39 chrome.send('metricsHandler:recordAction', 40 chrome.send('metricsHandler:recordAction',
40 ['AutomaticSettingsReset_WebUIBanner_LearnMoreClicked']); 41 ['AutomaticSettingsReset_WebUIBanner_LearnMoreClicked']);
41 }; 42 };
42 $('automatic-settings-reset-banner-activate-reset').onclick = 43 $('automatic-settings-reset-banner-activate-reset').onclick =
43 function(event) { 44 function(event) {
44 chrome.send('metricsHandler:recordAction', 45 chrome.send('metricsHandler:recordAction',
45 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']); 46 ['AutomaticSettingsReset_WebUIBanner_ResetClicked']);
46 OptionsPage.navigateToPage('resetProfileSettings'); 47 PageManager.showPageByName('resetProfileSettings');
47 }; 48 };
48 }, 49 },
49 }; 50 };
50 51
51 // Forward public APIs to private implementations. 52 // Forward public APIs to private implementations.
52 [ 53 [
53 'show', 54 'show',
54 'dismiss', 55 'dismiss',
55 ].forEach(function(name) { 56 ].forEach(function(name) {
56 AutomaticSettingsResetBanner[name] = function() { 57 AutomaticSettingsResetBanner[name] = function() {
57 var instance = AutomaticSettingsResetBanner.getInstance(); 58 var instance = AutomaticSettingsResetBanner.getInstance();
58 return instance[name + '_'].apply(instance, arguments); 59 return instance[name + '_'].apply(instance, arguments);
59 }; 60 };
60 }); 61 });
61 62
62 // Export 63 // Export
63 return { 64 return {
64 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner 65 AutomaticSettingsResetBanner: AutomaticSettingsResetBanner
65 }; 66 };
66 }); 67 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/autofill_options.js ('k') | chrome/browser/resources/options/browser_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698