| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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('settings', function() { | 5 cr.define('settings', function() { |
| 6 /** | 6 /** |
| 7 * Class for navigable routes. May only be instantiated within this file. | 7 * Class for navigable routes. May only be instantiated within this file. |
| 8 * @constructor | 8 * @constructor |
| 9 * @param {string} path | 9 * @param {string} path |
| 10 * @private | 10 * @private |
| 11 */ | 11 */ |
| 12 var Route = function(path) { | 12 var Route = function(path) { |
| 13 this.path = path; | 13 this.path = path; |
| 14 | 14 |
| 15 /** @type {?settings.Route} */ | 15 /** @type {?settings.Route} */ |
| 16 this.parent = null; | 16 this.parent = null; |
| 17 | 17 |
| 18 // Below are all legacy properties to provide compatibility with the old | 18 // Below are all legacy properties to provide compatibility with the old |
| 19 // routing system. TODO(tommycli): Remove once routing refactor complete. | 19 // routing system. TODO(tommycli): Remove once routing refactor complete. |
| 20 this.section = ''; | 20 this.section = ''; |
| 21 /** @type {!Array<string>} */ this.subpage = []; | |
| 22 }; | 21 }; |
| 23 | 22 |
| 24 Route.prototype = { | 23 Route.prototype = { |
| 25 /** | 24 /** |
| 26 * Returns a new Route instance that's a child of this route. | 25 * Returns a new Route instance that's a child of this route. |
| 27 * @param {string} path Extends this route's path if it doesn't contain a | 26 * @param {string} path Extends this route's path if it doesn't contain a |
| 28 * leading slash. | 27 * leading slash. |
| 29 * @param {string=} opt_subpageName | |
| 30 * @return {!settings.Route} | 28 * @return {!settings.Route} |
| 31 * @private | 29 * @private |
| 32 */ | 30 */ |
| 33 createChild: function(path, opt_subpageName) { | 31 createChild: function(path) { |
| 34 assert(path); | 32 assert(path); |
| 35 | 33 |
| 36 // |path| extends this route's path if it doesn't have a leading slash. | 34 // |path| extends this route's path if it doesn't have a leading slash. |
| 37 // If it does have a leading slash, it's just set as the new route's URL. | 35 // If it does have a leading slash, it's just set as the new route's URL. |
| 38 var newUrl = path[0] == '/' ? path : this.path + '/' + path; | 36 var newUrl = path[0] == '/' ? path : this.path + '/' + path; |
| 39 | 37 |
| 40 var route = new Route(newUrl); | 38 var route = new Route(newUrl); |
| 41 route.parent = this; | 39 route.parent = this; |
| 42 route.section = this.section; | 40 route.section = this.section; |
| 43 route.subpage = this.subpage.slice(); // Shallow copy. | |
| 44 | 41 |
| 45 if (opt_subpageName) | |
| 46 route.subpage.push(opt_subpageName); | |
| 47 | |
| 48 return route; | |
| 49 }, | |
| 50 | |
| 51 /** | |
| 52 * Returns a new Route instance that's a child dialog of this route. | |
| 53 * @param {string} path | |
| 54 * @param {string} dialogName | |
| 55 * @return {!settings.Route} | |
| 56 * @private | |
| 57 */ | |
| 58 createDialog: function(path, dialogName) { | |
| 59 var route = this.createChild(path); | |
| 60 route.dialog = dialogName; | |
| 61 return route; | 42 return route; |
| 62 }, | 43 }, |
| 63 | 44 |
| 64 /** | 45 /** |
| 65 * Returns a new Route instance that's a child section of this route. | 46 * Returns a new Route instance that's a child section of this route. |
| 66 * TODO(tommycli): Remove once we've obsoleted the concept of sections. | 47 * TODO(tommycli): Remove once we've obsoleted the concept of sections. |
| 67 * @param {string} path | 48 * @param {string} path |
| 68 * @param {string} section | 49 * @param {string} section |
| 69 * @return {!settings.Route} | 50 * @return {!settings.Route} |
| 70 * @private | 51 * @private |
| 71 */ | 52 */ |
| 72 createSection: function(path, section) { | 53 createSection: function(path, section) { |
| 73 var route = this.createChild(path); | 54 var route = this.createChild(path); |
| 74 route.section = section; | 55 route.section = section; |
| 75 return route; | 56 return route; |
| 76 }, | 57 }, |
| 77 | 58 |
| 78 /** | 59 /** |
| 79 * Returns true if this route matches or is an ancestor of the parameter. | 60 * Returns true if this route matches or is an ancestor of the parameter. |
| 80 * @param {!settings.Route} route | 61 * @param {!settings.Route} route |
| 81 * @return {boolean} | 62 * @return {boolean} |
| 82 */ | 63 */ |
| 83 contains: function(route) { | 64 contains: function(route) { |
| 84 for (var r = route; r != null; r = r.parent) { | 65 for (var r = route; r != null; r = r.parent) { |
| 85 if (this == r) | 66 if (this == r) |
| 86 return true; | 67 return true; |
| 87 } | 68 } |
| 88 return false; | 69 return false; |
| 89 }, | 70 }, |
| 71 |
| 72 /** |
| 73 * Returns true if this route is a subpage of a section. |
| 74 * @return {boolean} |
| 75 */ |
| 76 isSubpage: function() { |
| 77 return !!this.parent && this.parent.section == this.section; |
| 78 }, |
| 90 }; | 79 }; |
| 91 | 80 |
| 92 // Abbreviated variable for easier definitions. | 81 // Abbreviated variable for easier definitions. |
| 93 var r = Route; | 82 var r = Route; |
| 94 | 83 |
| 95 // Root pages. | 84 // Root pages. |
| 96 r.BASIC = new Route('/'); | 85 r.BASIC = new Route('/'); |
| 97 r.ADVANCED = new Route('/advanced'); | 86 r.ADVANCED = new Route('/advanced'); |
| 98 r.ABOUT = new Route('/help'); | 87 r.ABOUT = new Route('/help'); |
| 99 | 88 |
| 100 <if expr="chromeos"> | 89 <if expr="chromeos"> |
| 101 r.INTERNET = r.BASIC.createSection('/internet', 'internet'); | 90 r.INTERNET = r.BASIC.createSection('/internet', 'internet'); |
| 102 r.NETWORK_DETAIL = r.INTERNET.createChild('/networkDetail', 'network-detail'); | 91 r.NETWORK_DETAIL = r.INTERNET.createChild('/networkDetail'); |
| 103 r.KNOWN_NETWORKS = r.INTERNET.createChild('/knownNetworks', 'known-networks'); | 92 r.KNOWN_NETWORKS = r.INTERNET.createChild('/knownNetworks'); |
| 104 </if> | 93 </if> |
| 105 | 94 |
| 106 r.APPEARANCE = r.BASIC.createSection('/appearance', 'appearance'); | 95 r.APPEARANCE = r.BASIC.createSection('/appearance', 'appearance'); |
| 107 r.FONTS = r.APPEARANCE.createChild('/fonts', 'appearance-fonts'); | 96 r.FONTS = r.APPEARANCE.createChild('/fonts'); |
| 108 | 97 |
| 109 r.DEFAULT_BROWSER = | 98 r.DEFAULT_BROWSER = |
| 110 r.BASIC.createSection('/defaultBrowser', 'defaultBrowser'); | 99 r.BASIC.createSection('/defaultBrowser', 'defaultBrowser'); |
| 111 | 100 |
| 112 r.SEARCH = r.BASIC.createSection('/search', 'search'); | 101 r.SEARCH = r.BASIC.createSection('/search', 'search'); |
| 113 r.SEARCH_ENGINES = r.SEARCH.createChild('/searchEngines', 'search-engines'); | 102 r.SEARCH_ENGINES = r.SEARCH.createChild('/searchEngines'); |
| 114 | 103 |
| 115 r.ON_STARTUP = r.BASIC.createSection('/onStartup', 'onStartup'); | 104 r.ON_STARTUP = r.BASIC.createSection('/onStartup', 'onStartup'); |
| 116 | 105 |
| 117 r.PEOPLE = r.BASIC.createSection('/people', 'people'); | 106 r.PEOPLE = r.BASIC.createSection('/people', 'people'); |
| 118 r.SYNC = r.PEOPLE.createChild('/syncSetup', 'sync'); | 107 r.SYNC = r.PEOPLE.createChild('/syncSetup'); |
| 119 <if expr="not chromeos"> | 108 <if expr="not chromeos"> |
| 120 r.MANAGE_PROFILE = r.PEOPLE.createChild('/manageProfile', 'manageProfile'); | 109 r.MANAGE_PROFILE = r.PEOPLE.createChild('/manageProfile'); |
| 121 </if> | 110 </if> |
| 122 <if expr="chromeos"> | 111 <if expr="chromeos"> |
| 123 r.CHANGE_PICTURE = r.PEOPLE.createChild('/changePicture', 'changePicture'); | 112 r.CHANGE_PICTURE = r.PEOPLE.createChild('/changePicture'); |
| 124 r.ACCOUNTS = r.PEOPLE.createChild('/accounts', 'users'); | 113 r.ACCOUNTS = r.PEOPLE.createChild('/accounts'); |
| 125 r.LOCK_SCREEN = r.PEOPLE.createChild('/lockScreen', 'lockScreen'); | 114 r.LOCK_SCREEN = r.PEOPLE.createChild('/lockScreen'); |
| 126 r.SETUP_PIN = r.LOCK_SCREEN.createDialog('/setupPin', 'setupPin'); | |
| 127 | 115 |
| 128 r.DEVICE = r.BASIC.createSection('/device', 'device'); | 116 r.DEVICE = r.BASIC.createSection('/device', 'device'); |
| 129 r.POINTERS = r.DEVICE.createChild('/pointer-overlay', 'pointers'); | 117 r.POINTERS = r.DEVICE.createChild('/pointer-overlay'); |
| 130 r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay', 'keyboard'); | 118 r.KEYBOARD = r.DEVICE.createChild('/keyboard-overlay'); |
| 131 r.DISPLAY = r.DEVICE.createChild('/display', 'display'); | 119 r.DISPLAY = r.DEVICE.createChild('/display'); |
| 132 r.NOTES = r.DEVICE.createChild('/note', 'note'); | 120 r.NOTES = r.DEVICE.createChild('/note'); |
| 133 </if> | 121 </if> |
| 134 | 122 |
| 135 r.PRIVACY = r.ADVANCED.createSection('/privacy', 'privacy'); | 123 r.PRIVACY = r.ADVANCED.createSection('/privacy', 'privacy'); |
| 136 r.CERTIFICATES = | 124 r.CERTIFICATES = r.PRIVACY.createChild('/certificates'); |
| 137 r.PRIVACY.createChild('/certificates', 'manage-certificates'); | |
| 138 r.CLEAR_BROWSER_DATA = | |
| 139 r.PRIVACY.createDialog('/clearBrowserData', 'clear-browsing-data'); | |
| 140 r.SITE_SETTINGS = r.PRIVACY.createChild('/siteSettings', 'site-settings'); | |
| 141 r.SITE_SETTINGS_ALL = r.SITE_SETTINGS.createChild('all', 'all-sites'); | |
| 142 r.SITE_SETTINGS_ALL_DETAILS = | |
| 143 r.SITE_SETTINGS_ALL.createChild('details', 'site-details'); | |
| 144 | 125 |
| 145 r.SITE_SETTINGS_HANDLERS = r.SITE_SETTINGS.createChild( | 126 // CLEAR_BROWSER_DATA is the only navigable dialog route. It's the only child |
| 146 'handlers', 'protocol-handlers'); | 127 // of a section that's not a subpage. Don't add any more routes like these. |
| 128 // If more navigable dialogs are needed, add explicit support in Route. |
| 129 r.CLEAR_BROWSER_DATA = r.PRIVACY.createChild('/clearBrowserData'); |
| 130 r.CLEAR_BROWSER_DATA.isSubpage = function() { return false; }; |
| 147 | 131 |
| 148 // TODO(tommicli): Find a way to refactor these repetitive category routes. | 132 r.SITE_SETTINGS = r.PRIVACY.createChild('/siteSettings'); |
| 149 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS = r.SITE_SETTINGS.createChild( | 133 r.SITE_SETTINGS_ALL = r.SITE_SETTINGS.createChild('all'); |
| 150 'automaticDownloads', 'site-settings-category-automatic-downloads'); | 134 r.SITE_SETTINGS_ALL_DETAILS = r.SITE_SETTINGS_ALL.createChild('details'); |
| 151 r.SITE_SETTINGS_BACKGROUND_SYNC = r.SITE_SETTINGS.createChild( | 135 |
| 152 'backgroundSync', 'site-settings-category-background-sync'); | 136 r.SITE_SETTINGS_HANDLERS = r.SITE_SETTINGS.createChild('handlers'); |
| 153 r.SITE_SETTINGS_CAMERA = r.SITE_SETTINGS.createChild( | 137 |
| 154 'camera', 'site-settings-category-camera'); | 138 // TODO(tommycli): Find a way to refactor these repetitive category routes. |
| 155 r.SITE_SETTINGS_COOKIES = r.SITE_SETTINGS.createChild( | 139 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS = |
| 156 'cookies', 'site-settings-category-cookies'); | 140 r.SITE_SETTINGS.createChild('automaticDownloads'); |
| 157 r.SITE_SETTINGS_IMAGES = r.SITE_SETTINGS.createChild( | 141 r.SITE_SETTINGS_BACKGROUND_SYNC = |
| 158 'images', 'site-settings-category-images'); | 142 r.SITE_SETTINGS.createChild('backgroundSync'); |
| 159 r.SITE_SETTINGS_JAVASCRIPT = r.SITE_SETTINGS.createChild( | 143 r.SITE_SETTINGS_CAMERA = r.SITE_SETTINGS.createChild('camera'); |
| 160 'javascript', 'site-settings-category-javascript'); | 144 r.SITE_SETTINGS_COOKIES = r.SITE_SETTINGS.createChild('cookies'); |
| 161 r.SITE_SETTINGS_KEYGEN = r.SITE_SETTINGS.createChild( | 145 r.SITE_SETTINGS_IMAGES = r.SITE_SETTINGS.createChild('images'); |
| 162 'keygen', 'site-settings-category-keygen'); | 146 r.SITE_SETTINGS_JAVASCRIPT = r.SITE_SETTINGS.createChild('javascript'); |
| 163 r.SITE_SETTINGS_LOCATION = r.SITE_SETTINGS.createChild( | 147 r.SITE_SETTINGS_KEYGEN = r.SITE_SETTINGS.createChild('keygen'); |
| 164 'location', 'site-settings-category-location'); | 148 r.SITE_SETTINGS_LOCATION = r.SITE_SETTINGS.createChild('location'); |
| 165 r.SITE_SETTINGS_MICROPHONE = r.SITE_SETTINGS.createChild( | 149 r.SITE_SETTINGS_MICROPHONE = r.SITE_SETTINGS.createChild('microphone'); |
| 166 'microphone', 'site-settings-category-microphone'); | 150 r.SITE_SETTINGS_NOTIFICATIONS = r.SITE_SETTINGS.createChild('notifications'); |
| 167 r.SITE_SETTINGS_NOTIFICATIONS = r.SITE_SETTINGS.createChild( | 151 r.SITE_SETTINGS_PLUGINS = r.SITE_SETTINGS.createChild('plugins'); |
| 168 'notifications', 'site-settings-category-notifications'); | 152 r.SITE_SETTINGS_POPUPS = r.SITE_SETTINGS.createChild('popups'); |
| 169 r.SITE_SETTINGS_PLUGINS = r.SITE_SETTINGS.createChild( | 153 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS = |
| 170 'plugins', 'site-settings-category-plugins'); | 154 r.SITE_SETTINGS.createChild('unsandboxedPlugins'); |
| 171 r.SITE_SETTINGS_POPUPS = r.SITE_SETTINGS.createChild( | |
| 172 'popups', 'site-settings-category-popups'); | |
| 173 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS = r.SITE_SETTINGS.createChild( | |
| 174 'unsandboxedPlugins', 'site-settings-category-unsandboxed-plugins'); | |
| 175 | 155 |
| 176 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS_DETAILS = | 156 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS_DETAILS = |
| 177 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS.createChild('details', | 157 r.SITE_SETTINGS_AUTOMATIC_DOWNLOADS.createChild('details'); |
| 178 'site-details'); | |
| 179 r.SITE_SETTINGS_BACKGROUND_SYNC_DETAILS = | 158 r.SITE_SETTINGS_BACKGROUND_SYNC_DETAILS = |
| 180 r.SITE_SETTINGS_BACKGROUND_SYNC.createChild('details', 'site-details'); | 159 r.SITE_SETTINGS_BACKGROUND_SYNC.createChild('details'); |
| 181 r.SITE_SETTINGS_CAMERA_DETAILS = | 160 r.SITE_SETTINGS_CAMERA_DETAILS = |
| 182 r.SITE_SETTINGS_CAMERA.createChild('details', 'site-details'); | 161 r.SITE_SETTINGS_CAMERA.createChild('details'); |
| 183 r.SITE_SETTINGS_COOKIES_DETAILS = | 162 r.SITE_SETTINGS_COOKIES_DETAILS = |
| 184 r.SITE_SETTINGS_COOKIES.createChild('details', 'site-details'); | 163 r.SITE_SETTINGS_COOKIES.createChild('details'); |
| 185 r.SITE_SETTINGS_IMAGES_DETAILS = | 164 r.SITE_SETTINGS_IMAGES_DETAILS = |
| 186 r.SITE_SETTINGS_IMAGES.createChild('details', 'site-details'); | 165 r.SITE_SETTINGS_IMAGES.createChild('details'); |
| 187 r.SITE_SETTINGS_JAVASCRIPT_DETAILS = | 166 r.SITE_SETTINGS_JAVASCRIPT_DETAILS = |
| 188 r.SITE_SETTINGS_JAVASCRIPT.createChild('details', 'site-details'); | 167 r.SITE_SETTINGS_JAVASCRIPT.createChild('details'); |
| 189 r.SITE_SETTINGS_KEYGEN_DETAILS = | 168 r.SITE_SETTINGS_KEYGEN_DETAILS = |
| 190 r.SITE_SETTINGS_KEYGEN.createChild('details', 'site-details'); | 169 r.SITE_SETTINGS_KEYGEN.createChild('details'); |
| 191 r.SITE_SETTINGS_LOCATION_DETAILS = | 170 r.SITE_SETTINGS_LOCATION_DETAILS = |
| 192 r.SITE_SETTINGS_LOCATION.createChild('details', 'site-details'); | 171 r.SITE_SETTINGS_LOCATION.createChild('details'); |
| 193 r.SITE_SETTINGS_MICROPHONE_DETAILS = | 172 r.SITE_SETTINGS_MICROPHONE_DETAILS = |
| 194 r.SITE_SETTINGS_MICROPHONE.createChild('details', 'site-details'); | 173 r.SITE_SETTINGS_MICROPHONE.createChild('details'); |
| 195 r.SITE_SETTINGS_NOTIFICATIONS_DETAILS = | 174 r.SITE_SETTINGS_NOTIFICATIONS_DETAILS = |
| 196 r.SITE_SETTINGS_NOTIFICATIONS.createChild('details', 'site-details'); | 175 r.SITE_SETTINGS_NOTIFICATIONS.createChild('details'); |
| 197 r.SITE_SETTINGS_PLUGINS_DETAILS = | 176 r.SITE_SETTINGS_PLUGINS_DETAILS = |
| 198 r.SITE_SETTINGS_PLUGINS.createChild('details', 'site-details'); | 177 r.SITE_SETTINGS_PLUGINS.createChild('details'); |
| 199 r.SITE_SETTINGS_POPUPS_DETAILS = | 178 r.SITE_SETTINGS_POPUPS_DETAILS = |
| 200 r.SITE_SETTINGS_POPUPS.createChild('details', 'site-details'); | 179 r.SITE_SETTINGS_POPUPS.createChild('details'); |
| 201 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS_DETAILS = | 180 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS_DETAILS = |
| 202 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS.createChild('details', | 181 r.SITE_SETTINGS_UNSANDBOXED_PLUGINS.createChild('details'); |
| 203 'site-details'); | |
| 204 | 182 |
| 205 <if expr="chromeos"> | 183 <if expr="chromeos"> |
| 206 r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime'); | 184 r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime'); |
| 207 | 185 |
| 208 r.BLUETOOTH = r.ADVANCED.createSection('/bluetooth', 'bluetooth'); | 186 r.BLUETOOTH = r.ADVANCED.createSection('/bluetooth', 'bluetooth'); |
| 209 r.BLUETOOTH_ADD_DEVICE = | 187 r.BLUETOOTH_ADD_DEVICE = r.BLUETOOTH.createChild('/bluetoothAddDevice'); |
| 210 r.BLUETOOTH.createChild('/bluetoothAddDevice', 'bluetooth-add-device'); | 188 r.BLUETOOTH_PAIR_DEVICE = |
| 211 r.BLUETOOTH_PAIR_DEVICE = r.BLUETOOTH_ADD_DEVICE.createChild( | 189 r.BLUETOOTH_ADD_DEVICE.createChild('bluetoothPairDevice'); |
| 212 'bluetoothPairDevice', 'bluetooth-pair-device'); | |
| 213 </if> | 190 </if> |
| 214 | 191 |
| 215 r.PASSWORDS = r.ADVANCED.createSection('/passwords', 'passwordsAndForms'); | 192 r.PASSWORDS = r.ADVANCED.createSection('/passwords', 'passwordsAndForms'); |
| 216 r.AUTOFILL = r.PASSWORDS.createChild('/autofill', 'manage-autofill'); | 193 r.AUTOFILL = r.PASSWORDS.createChild('/autofill'); |
| 217 r.MANAGE_PASSWORDS = | 194 r.MANAGE_PASSWORDS = r.PASSWORDS.createChild('/managePasswords'); |
| 218 r.PASSWORDS.createChild('/managePasswords', 'manage-passwords'); | |
| 219 | 195 |
| 220 r.LANGUAGES = r.ADVANCED.createSection('/languages', 'languages'); | 196 r.LANGUAGES = r.ADVANCED.createSection('/languages', 'languages'); |
| 221 r.LANGUAGES_DETAIL = r.LANGUAGES.createChild('edit', 'language-detail'); | 197 r.LANGUAGES_DETAIL = r.LANGUAGES.createChild('edit'); |
| 222 r.MANAGE_LANGUAGES = | 198 r.MANAGE_LANGUAGES = r.LANGUAGES.createChild('/manageLanguages'); |
| 223 r.LANGUAGES.createChild('/manageLanguages', 'manage-languages'); | |
| 224 <if expr="chromeos"> | 199 <if expr="chromeos"> |
| 225 r.INPUT_METHODS = | 200 r.INPUT_METHODS = r.LANGUAGES.createChild('/inputMethods'); |
| 226 r.LANGUAGES.createChild('/inputMethods', 'manage-input-methods'); | |
| 227 </if> | 201 </if> |
| 228 <if expr="not is_macosx"> | 202 <if expr="not is_macosx"> |
| 229 r.EDIT_DICTIONARY = | 203 r.EDIT_DICTIONARY = r.LANGUAGES.createChild('/editDictionary'); |
| 230 r.LANGUAGES.createChild('/editDictionary', 'edit-dictionary'); | |
| 231 </if> | 204 </if> |
| 232 | 205 |
| 233 r.DOWNLOADS = r.ADVANCED.createSection('/downloadsDirectory', 'downloads'); | 206 r.DOWNLOADS = r.ADVANCED.createSection('/downloadsDirectory', 'downloads'); |
| 234 | 207 |
| 235 r.PRINTING = r.ADVANCED.createSection('/printing', 'printing'); | 208 r.PRINTING = r.ADVANCED.createSection('/printing', 'printing'); |
| 236 r.CLOUD_PRINTERS = r.PRINTING.createChild('/cloudPrinters', 'cloud-printers'); | 209 r.CLOUD_PRINTERS = r.PRINTING.createChild('/cloudPrinters'); |
| 237 <if expr="chromeos"> | 210 <if expr="chromeos"> |
| 238 r.CUPS_PRINTERS = r.PRINTING.createChild('/cupsPrinters', 'cups-printers'); | 211 r.CUPS_PRINTERS = r.PRINTING.createChild('/cupsPrinters'); |
| 239 r.CUPS_PRINTER_DETAIL = r.CUPS_PRINTERS.createChild( | 212 r.CUPS_PRINTER_DETAIL = r.CUPS_PRINTERS.createChild('/cupsPrinterDetails'); |
| 240 '/cupsPrinterDetails', 'cups-printer-details-page'); | |
| 241 </if> | 213 </if> |
| 242 | 214 |
| 243 r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); | 215 r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); |
| 244 r.MANAGE_ACCESSIBILITY = r.ACCESSIBILITY.createChild( | 216 r.MANAGE_ACCESSIBILITY = r.ACCESSIBILITY.createChild('/manageAccessibility'); |
| 245 '/manageAccessibility', 'manage-a11y'); | |
| 246 | 217 |
| 247 r.SYSTEM = r.ADVANCED.createSection('/system', 'system'); | 218 r.SYSTEM = r.ADVANCED.createSection('/system', 'system'); |
| 248 r.RESET = r.ADVANCED.createSection('/reset', 'reset'); | 219 r.RESET = r.ADVANCED.createSection('/reset', 'reset'); |
| 249 | 220 |
| 250 <if expr="chromeos"> | 221 <if expr="chromeos"> |
| 251 r.INPUT_METHODS = | 222 r.INPUT_METHODS = r.LANGUAGES.createChild('/inputMethods'); |
| 252 r.LANGUAGES.createChild('/inputMethods', 'manage-input-methods'); | 223 r.DETAILED_BUILD_INFO = r.ABOUT.createChild('/help/details'); |
| 253 r.DETAILED_BUILD_INFO = | |
| 254 r.ABOUT.createChild('/help/details', 'detailed-build-info'); | |
| 255 r.DETAILED_BUILD_INFO.section = 'about'; | 224 r.DETAILED_BUILD_INFO.section = 'about'; |
| 256 </if> | 225 </if> |
| 257 | 226 |
| 258 var routeObservers_ = new Set(); | 227 var routeObservers_ = new Set(); |
| 259 | 228 |
| 260 /** @polymerBehavior */ | 229 /** @polymerBehavior */ |
| 261 var RouteObserverBehavior = { | 230 var RouteObserverBehavior = { |
| 262 /** @override */ | 231 /** @override */ |
| 263 attached: function() { | 232 attached: function() { |
| 264 assert(!routeObservers_.has(this)); | 233 assert(!routeObservers_.has(this)); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 341 |
| 373 return { | 342 return { |
| 374 Route: Route, | 343 Route: Route, |
| 375 RouteObserverBehavior: RouteObserverBehavior, | 344 RouteObserverBehavior: RouteObserverBehavior, |
| 376 getRouteForPath: getRouteForPath, | 345 getRouteForPath: getRouteForPath, |
| 377 getCurrentRoute: getCurrentRoute, | 346 getCurrentRoute: getCurrentRoute, |
| 378 getQueryParameters: getQueryParameters, | 347 getQueryParameters: getQueryParameters, |
| 379 navigateTo: navigateTo, | 348 navigateTo: navigateTo, |
| 380 }; | 349 }; |
| 381 }); | 350 }); |
| OLD | NEW |