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

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

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed feedback 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ResetProfileSettingsHandler. 5 // Note: the native-side handler for this is ResetProfileSettingsHandler.
6 6
7 cr.define('options', function() { 7 cr.define('options', function() {
8 /** @const */ var OptionsPage = options.OptionsPage; 8 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
9 /** @const */ var SettingsBannerBase = options.SettingsBannerBase; 9 /** @const */ var SettingsBannerBase = options.SettingsBannerBase;
10 10
11 /** 11 /**
12 * ResetProfileSettingsBanner class 12 * ResetProfileSettingsBanner class
13 * Provides encapsulated handling of the Reset Profile Settings banner. 13 * Provides encapsulated handling of the Reset Profile Settings banner.
14 * @constructor 14 * @constructor
15 */ 15 */
16 function ResetProfileSettingsBanner() {} 16 function ResetProfileSettingsBanner() {}
17 17
18 cr.addSingletonGetter(ResetProfileSettingsBanner); 18 cr.addSingletonGetter(ResetProfileSettingsBanner);
(...skipping 13 matching lines...) Expand all
32 this.setVisibilibyDomElement_ = $('reset-profile-settings-banner'); 32 this.setVisibilibyDomElement_ = $('reset-profile-settings-banner');
33 33
34 $('reset-profile-settings-banner-close').onclick = function(event) { 34 $('reset-profile-settings-banner-close').onclick = function(event) {
35 chrome.send('metricsHandler:recordAction', 35 chrome.send('metricsHandler:recordAction',
36 ['AutomaticReset_WebUIBanner_ManuallyClosed']); 36 ['AutomaticReset_WebUIBanner_ManuallyClosed']);
37 ResetProfileSettingsBanner.dismiss(); 37 ResetProfileSettingsBanner.dismiss();
38 }; 38 };
39 $('reset-profile-settings-banner-activate').onclick = function(event) { 39 $('reset-profile-settings-banner-activate').onclick = function(event) {
40 chrome.send('metricsHandler:recordAction', 40 chrome.send('metricsHandler:recordAction',
41 ['AutomaticReset_WebUIBanner_ResetClicked']); 41 ['AutomaticReset_WebUIBanner_ResetClicked']);
42 OptionsPage.navigateToPage('resetProfileSettings'); 42 PageManager.showPageByName('resetProfileSettings');
43 }; 43 };
44 }, 44 },
45 }; 45 };
46 46
47 // Forward public APIs to private implementations. 47 // Forward public APIs to private implementations.
48 [ 48 [
49 'show', 49 'show',
50 'dismiss', 50 'dismiss',
51 ].forEach(function(name) { 51 ].forEach(function(name) {
52 ResetProfileSettingsBanner[name] = function() { 52 ResetProfileSettingsBanner[name] = function() {
53 var instance = ResetProfileSettingsBanner.getInstance(); 53 var instance = ResetProfileSettingsBanner.getInstance();
54 return instance[name + '_'].apply(instance, arguments); 54 return instance[name + '_'].apply(instance, arguments);
55 }; 55 };
56 }); 56 });
57 57
58 // Export 58 // Export
59 return { 59 return {
60 ResetProfileSettingsBanner: ResetProfileSettingsBanner 60 ResetProfileSettingsBanner: ResetProfileSettingsBanner
61 }; 61 };
62 }); 62 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698