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

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

Issue 7337007: Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added opt-out histogram Created 9 years, 5 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 7
8 function InstantConfirmOverlay() { 8 function InstantConfirmOverlay() {
9 OptionsPage.call(this, 'instantConfirm', 9 OptionsPage.call(this, 'instantConfirm',
10 templateData.instantConfirmTitle, 10 templateData.instantConfirmTitle,
11 'instantConfirmOverlay'); 11 'instantConfirmOverlay');
12 }; 12 };
13 13
14 cr.addSingletonGetter(InstantConfirmOverlay); 14 cr.addSingletonGetter(InstantConfirmOverlay);
15 15
16 InstantConfirmOverlay.prototype = { 16 InstantConfirmOverlay.prototype = {
17 // Inherit from OptionsPage. 17 // Inherit from OptionsPage.
18 __proto__: OptionsPage.prototype, 18 __proto__: OptionsPage.prototype,
19 19
20 initializePage: function() { 20 initializePage: function() {
21 OptionsPage.prototype.initializePage.call(this); 21 OptionsPage.prototype.initializePage.call(this);
22 22
23 $('instantConfirmCancel').onclick = function() { 23 $('instantConfirmCancel').onclick = function() {
24 OptionsPage.closeOverlay(); 24 OptionsPage.closeOverlay();
25 $('instantEnabledCheckbox').checked = false;
25 }; 26 };
27
26 $('instantConfirmOk').onclick = function() { 28 $('instantConfirmOk').onclick = function() {
27 OptionsPage.closeOverlay(); 29 OptionsPage.closeOverlay();
28 Preferences.setBooleanPref('instant.confirm_dialog_shown', true); 30 chrome.send('enableInstant');
29 var instantEnabledCheckbox = $('instantEnableCheckbox');
30 Preferences.setBooleanPref(instantEnableCheckbox.pref, true,
31 instantEnableCheckbox.metric);
32 }; 31 };
33 }, 32 },
34 }; 33 };
35 34
36 // Export 35 // Export
37 return { 36 return {
38 InstantConfirmOverlay: InstantConfirmOverlay 37 InstantConfirmOverlay: InstantConfirmOverlay
39 }; 38 };
40 }); 39 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698