OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // Search section. | 164 // Search section. |
165 $('manage-default-search-engines').onclick = function(event) { | 165 $('manage-default-search-engines').onclick = function(event) { |
166 OptionsPage.navigateToPage('searchEngines'); | 166 OptionsPage.navigateToPage('searchEngines'); |
167 chrome.send('coreOptionsUserMetricsAction', | 167 chrome.send('coreOptionsUserMetricsAction', |
168 ['Options_ManageSearchEngines']); | 168 ['Options_ManageSearchEngines']); |
169 }; | 169 }; |
170 $('default-search-engine').addEventListener('change', | 170 $('default-search-engine').addEventListener('change', |
171 this.setDefaultSearchEngine_); | 171 this.setDefaultSearchEngine_); |
172 | 172 |
173 // Users section. | 173 // Users section. |
174 if (loadTimeData.valueExists('profilesInfo')) { | 174 if (loadTimeData.getBoolean('showProfilesSection')) { |
175 $('profiles-section').hidden = false; | 175 $('profiles-section').hidden = false; |
176 | 176 |
177 var profilesList = $('profiles-list'); | 177 var profilesList = $('profiles-list'); |
178 options.browser_options.ProfileList.decorate(profilesList); | 178 options.browser_options.ProfileList.decorate(profilesList); |
179 profilesList.autoExpands = true; | 179 profilesList.autoExpands = true; |
180 | 180 |
181 this.setProfilesInfo_(loadTimeData.getValue('profilesInfo')); | 181 chrome.send('requestProfilesInfo'); |
182 | 182 |
183 profilesList.addEventListener('change', | 183 profilesList.addEventListener('change', |
184 this.setProfileViewButtonsStatus_); | 184 this.setProfileViewButtonsStatus_); |
185 $('profiles-create').onclick = function(event) { | 185 $('profiles-create').onclick = function(event) { |
186 ManageProfileOverlay.showCreateDialog(); | 186 ManageProfileOverlay.showCreateDialog(); |
187 }; | 187 }; |
188 if (OptionsPage.isSettingsApp()) { | 188 if (OptionsPage.isSettingsApp()) { |
189 $('profiles-app-list-switch').onclick = function(event) { | 189 $('profiles-app-list-switch').onclick = function(event) { |
190 var selectedProfile = self.getSelectedProfileItem_(); | 190 var selectedProfile = self.getSelectedProfileItem_(); |
191 chrome.send('switchAppListProfile', [selectedProfile.filePath]); | 191 chrome.send('switchAppListProfile', [selectedProfile.filePath]); |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 BrowserOptions.getLoggedInUsername = function() { | 1504 BrowserOptions.getLoggedInUsername = function() { |
1505 return BrowserOptions.getInstance().username_; | 1505 return BrowserOptions.getInstance().username_; |
1506 }; | 1506 }; |
1507 } | 1507 } |
1508 | 1508 |
1509 // Export | 1509 // Export |
1510 return { | 1510 return { |
1511 BrowserOptions: BrowserOptions | 1511 BrowserOptions: BrowserOptions |
1512 }; | 1512 }; |
1513 }); | 1513 }); |
OLD | NEW |