author | Eugene Ostroukhov <eostroukhov@gmail.com> |
Thu, 28 Jan 2010 10:18:04 -0800 | |
changeset 55 | bb6160d0b6f2 |
parent 54 | 5a2cfa9bc743 |
child 450 | ed815e0eef9a |
permissions | -rw-r--r-- |
2 | 1 |
/******************************************************************************* |
2 |
* Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Symbian Foundation - initial contribution. |
|
11 |
* Contributors: |
|
12 |
* Description: |
|
13 |
* Overview: |
|
14 |
* Details: |
|
15 |
* Platforms/Drives/Compatibility: |
|
16 |
* Assumptions/Requirement/Pre-requisites: |
|
17 |
* Failures and causes: |
|
18 |
*******************************************************************************/ |
|
19 |
package org.symbian.tools.wrttools.debug.internal; |
|
20 |
||
21 |
import java.io.File; |
|
22 |
||
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
23 |
import org.symbian.tools.wrttools.util.CoreUtil; |
2 | 24 |
|
25 |
public final class ChromeDebugUtils { |
|
26 |
public static String getExecutablePath(String folder) { |
|
27 |
File file = new File(folder); |
|
28 |
if (file.isDirectory()) { |
|
29 |
File chromeExecutable = new File(file, getExecutable()); |
|
30 |
if (chromeExecutable.isFile()) { |
|
31 |
return chromeExecutable.getAbsolutePath(); |
|
32 |
} |
|
33 |
} |
|
34 |
return null; |
|
35 |
} |
|
36 |
||
37 |
private static String getExecutable() { |
|
38 |
// Add more ifs as we add support for new platforms |
|
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
39 |
if (CoreUtil.isMac()) { |
2 | 40 |
return "Google Chrome.app/Contents/MacOS/Google Chrome"; |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
41 |
} else if (CoreUtil.isLinux()) { |
43
464130c45935
Linux support, first cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
42 |
return "chrome"; |
2 | 43 |
} else { |
44 |
return "chrome.exe"; |
|
45 |
} |
|
46 |
} |
|
47 |
||
48 |
private ChromeDebugUtils() { |
|
49 |
// No instantiating |
|
50 |
} |
|
51 |
||
52 |
public static String getChromeExecutible() { |
|
53 |
return getExecutablePath(Activator.getDefault().getPreferenceStore().getString(IConstants.PREF_NAME_CHROME_LOCATION)); |
|
54 |
} |
|
55 |
||
56 |
} |