| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Let the wrapped binary know that it has been run through the wrapper. | 7 # Let the wrapped binary know that it has been run through the wrapper. |
| 8 export CHROME_WRAPPER="`readlink -f "$0"`" | 8 export CHROME_WRAPPER="`readlink -f "$0"`" |
| 9 | 9 |
| 10 HERE="`dirname "$CHROME_WRAPPER"`" | 10 HERE="`dirname "$CHROME_WRAPPER"`" |
| 11 | 11 |
| 12 # Check if the CPU supports SSE2. If not, try to pop up a dialog to explain the |
| 13 # problem and exit. Otherwise the browser will just crash with a SIGILL. |
| 14 # http://crbug.com/348761 |
| 15 grep ^flags /proc/cpuinfo|grep -qs sse2 |
| 16 if [ $? != 0 ]; then |
| 17 SSE2_DEPRECATION_MSG="This computer can no longer run Google Chrome because \ |
| 18 its hardware is no longer supported." |
| 19 if which zenity &> /dev/null; then |
| 20 zenity --warning --text="$SSE2_DEPRECATION_MSG" |
| 21 elif which gmessage &> /dev/null; then |
| 22 gmessage "$SSE2_DEPRECATION_MSG" |
| 23 elif which xmessage &> /dev/null; then |
| 24 xmessage "$SSE2_DEPRECATION_MSG" |
| 25 else |
| 26 echo "$SSE2_DEPRECATION_MSG" 1>&2 |
| 27 fi |
| 28 exit 1 |
| 29 fi |
| 30 |
| 12 # We include some xdg utilities next to the binary, and we want to prefer them | 31 # We include some xdg utilities next to the binary, and we want to prefer them |
| 13 # over the system versions when we know the system versions are very old. We | 32 # over the system versions when we know the system versions are very old. We |
| 14 # detect whether the system xdg utilities are sufficiently new to be likely to | 33 # detect whether the system xdg utilities are sufficiently new to be likely to |
| 15 # work for us by looking for xdg-settings. If we find it, we leave $PATH alone, | 34 # work for us by looking for xdg-settings. If we find it, we leave $PATH alone, |
| 16 # so that the system xdg utilities (including any distro patches) will be used. | 35 # so that the system xdg utilities (including any distro patches) will be used. |
| 17 if ! which xdg-settings &> /dev/null; then | 36 if ! which xdg-settings &> /dev/null; then |
| 18 # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. | 37 # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. |
| 19 export PATH="$HERE:$PATH" | 38 export PATH="$HERE:$PATH" |
| 20 else | 39 else |
| 21 # Use system xdg utilities. But first create mimeapps.list if it doesn't | 40 # Use system xdg utilities. But first create mimeapps.list if it doesn't |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 | 69 |
| 51 # Make sure that the profile directory specified in the environment, if any, | 70 # Make sure that the profile directory specified in the environment, if any, |
| 52 # overrides the default. | 71 # overrides the default. |
| 53 if [[ -n "$CHROME_USER_DATA_DIR" ]]; then | 72 if [[ -n "$CHROME_USER_DATA_DIR" ]]; then |
| 54 PROFILE_DIRECTORY_FLAG="--user-data-dir=$CHROME_USER_DATA_DIR" | 73 PROFILE_DIRECTORY_FLAG="--user-data-dir=$CHROME_USER_DATA_DIR" |
| 55 fi | 74 fi |
| 56 | 75 |
| 57 # Note: exec -a below is a bashism. | 76 # Note: exec -a below is a bashism. |
| 58 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ "$PROFILE_DIRECTORY_FLAG" \ | 77 exec -a "$0" "$HERE/@@PROGNAME@@" @@DEFAULT_FLAGS@@ "$PROFILE_DIRECTORY_FLAG" \ |
| 59 "$@" | 78 "$@" |
| OLD | NEW |