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 /** | 5 /** |
6 * Dictionary of constants (Initialized soon after loading by data from browser, | 6 * Dictionary of constants (Initialized soon after loading by data from browser, |
7 * updated on load log). The *Types dictionaries map strings to numeric IDs, | 7 * updated on load log). The *Types dictionaries map strings to numeric IDs, |
8 * while the *TypeNames are the other way around. | 8 * while the *TypeNames are the other way around. |
9 */ | 9 */ |
10 var EventType = null; | 10 var EventType = null; |
(...skipping 29 matching lines...) Expand all Loading... |
40 // We inherit from HorizontalSplitView | 40 // We inherit from HorizontalSplitView |
41 var superClass = HorizontalSplitView; | 41 var superClass = HorizontalSplitView; |
42 | 42 |
43 /** | 43 /** |
44 * Main entry point. Called once the page has loaded. | 44 * Main entry point. Called once the page has loaded. |
45 * @constructor | 45 * @constructor |
46 */ | 46 */ |
47 function MainView() { | 47 function MainView() { |
48 assertFirstConstructorCall(MainView); | 48 assertFirstConstructorCall(MainView); |
49 | 49 |
| 50 if (hasTouchScreen()) |
| 51 document.body.classList.add('touch'); |
| 52 |
50 // This must be initialized before the tabs, so they can register as | 53 // This must be initialized before the tabs, so they can register as |
51 // observers. | 54 // observers. |
52 g_browser = BrowserBridge.getInstance(); | 55 g_browser = BrowserBridge.getInstance(); |
53 | 56 |
54 // This must be the first constants observer, so other constants observers | 57 // This must be the first constants observer, so other constants observers |
55 // can safely use the globals, rather than depending on walking through | 58 // can safely use the globals, rather than depending on walking through |
56 // the constants themselves. | 59 // the constants themselves. |
57 g_browser.addConstantsObserver(new ConstantsObserver()); | 60 g_browser.addConstantsObserver(new ConstantsObserver()); |
58 | 61 |
59 // This view is a left navigation bar. | 62 // This view is a left navigation bar. |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 * Returns a string representation of |family|. | 299 * Returns a string representation of |family|. |
297 * @param {number} family An AddressFamily | 300 * @param {number} family An AddressFamily |
298 * @return {string} A representation of the given family. | 301 * @return {string} A representation of the given family. |
299 */ | 302 */ |
300 function addressFamilyToString(family) { | 303 function addressFamilyToString(family) { |
301 var str = getKeyWithValue(AddressFamily, family); | 304 var str = getKeyWithValue(AddressFamily, family); |
302 // All the address family start with ADDRESS_FAMILY_*. | 305 // All the address family start with ADDRESS_FAMILY_*. |
303 // Strip that prefix since it is redundant and only clutters the output. | 306 // Strip that prefix since it is redundant and only clutters the output. |
304 return str.replace(/^ADDRESS_FAMILY_/, ''); | 307 return str.replace(/^ADDRESS_FAMILY_/, ''); |
305 } | 308 } |
OLD | NEW |