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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/host/Platform.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 10 matching lines...) Expand all
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 /** 28 /**
29 * @return {string} 29 * @return {string}
30 */ 30 */
31 WebInspector.platform = function() { 31 Host.platform = function() {
32 if (!WebInspector._platform) 32 if (!Host._platform)
33 WebInspector._platform = InspectorFrontendHost.platform(); 33 Host._platform = InspectorFrontendHost.platform();
34 return WebInspector._platform; 34 return Host._platform;
35 }; 35 };
36 36
37 /** 37 /**
38 * @return {boolean} 38 * @return {boolean}
39 */ 39 */
40 WebInspector.isMac = function() { 40 Host.isMac = function() {
41 if (typeof WebInspector._isMac === 'undefined') 41 if (typeof Host._isMac === 'undefined')
42 WebInspector._isMac = WebInspector.platform() === 'mac'; 42 Host._isMac = Host.platform() === 'mac';
43 43
44 return WebInspector._isMac; 44 return Host._isMac;
45 }; 45 };
46 46
47 /** 47 /**
48 * @return {boolean} 48 * @return {boolean}
49 */ 49 */
50 WebInspector.isWin = function() { 50 Host.isWin = function() {
51 if (typeof WebInspector._isWin === 'undefined') 51 if (typeof Host._isWin === 'undefined')
52 WebInspector._isWin = WebInspector.platform() === 'windows'; 52 Host._isWin = Host.platform() === 'windows';
53 53
54 return WebInspector._isWin; 54 return Host._isWin;
55 }; 55 };
56 56
57 /** 57 /**
58 * @return {boolean} 58 * @return {boolean}
59 */ 59 */
60 WebInspector.isCustomDevtoolsFrontend = function() { 60 Host.isCustomDevtoolsFrontend = function() {
61 if (typeof WebInspector._isCustomDevtoolsFronend === 'undefined') 61 if (typeof Host._isCustomDevtoolsFronend === 'undefined')
62 WebInspector._isCustomDevtoolsFronend = window.location.toString().startsWit h('chrome-devtools://devtools/custom/'); 62 Host._isCustomDevtoolsFronend = window.location.toString().startsWith('chrom e-devtools://devtools/custom/');
63 return WebInspector._isCustomDevtoolsFronend; 63 return Host._isCustomDevtoolsFronend;
64 }; 64 };
65 65
66 /** 66 /**
67 * @return {string} 67 * @return {string}
68 */ 68 */
69 WebInspector.fontFamily = function() { 69 Host.fontFamily = function() {
70 if (WebInspector._fontFamily) 70 if (Host._fontFamily)
71 return WebInspector._fontFamily; 71 return Host._fontFamily;
72 switch (WebInspector.platform()) { 72 switch (Host.platform()) {
73 case 'linux': 73 case 'linux':
74 WebInspector._fontFamily = 'Ubuntu, Arial, sans-serif'; 74 Host._fontFamily = 'Ubuntu, Arial, sans-serif';
75 break; 75 break;
76 case 'mac': 76 case 'mac':
77 WebInspector._fontFamily = '\'Lucida Grande\', sans-serif'; 77 Host._fontFamily = '\'Lucida Grande\', sans-serif';
78 break; 78 break;
79 case 'windows': 79 case 'windows':
80 WebInspector._fontFamily = '\'Segoe UI\', Tahoma, sans-serif'; 80 Host._fontFamily = '\'Segoe UI\', Tahoma, sans-serif';
81 break; 81 break;
82 } 82 }
83 return WebInspector._fontFamily; 83 return Host._fontFamily;
84 }; 84 };
85 85
86 /** 86 /**
87 * @return {string} 87 * @return {string}
88 */ 88 */
89 WebInspector.monospaceFontFamily = function() { 89 Host.monospaceFontFamily = function() {
90 if (WebInspector._monospaceFontFamily) 90 if (Host._monospaceFontFamily)
91 return WebInspector._monospaceFontFamily; 91 return Host._monospaceFontFamily;
92 switch (WebInspector.platform()) { 92 switch (Host.platform()) {
93 case 'linux': 93 case 'linux':
94 WebInspector._monospaceFontFamily = 'dejavu sans mono, monospace'; 94 Host._monospaceFontFamily = 'dejavu sans mono, monospace';
95 break; 95 break;
96 case 'mac': 96 case 'mac':
97 WebInspector._monospaceFontFamily = 'Menlo, monospace'; 97 Host._monospaceFontFamily = 'Menlo, monospace';
98 break; 98 break;
99 case 'windows': 99 case 'windows':
100 WebInspector._monospaceFontFamily = 'Consolas, monospace'; 100 Host._monospaceFontFamily = 'Consolas, monospace';
101 break; 101 break;
102 } 102 }
103 return WebInspector._monospaceFontFamily; 103 return Host._monospaceFontFamily;
104 }; 104 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698