Prevent browser crashes when a site is added to shelf with extensions blacklisted.
Prevent browser crashes when a site is added to shelf with extensions blacklisted.

The bookmark app installer underpinning the add to shelf functionality
assumes the validity of the extension pointer returned from the app
installation process with a DCHECK. However, CrxInstaller issues a
DONE notification with a null extension pointer attached when
installation fails, e.g. when extensions are blacklisted. Dereferencing
the null pointer leads to a whole browser crash that is 100%
reproducible whenever add to shelf is used while extensions are
blacklisted (and under any other conditions which cause extension
installation to fail).

This CL fixes the crash by explicitly checking the extension pointer
instead of DCHECKing it. When a null extension pointer is returned from
CrxInstaller, add to shelf will silently fail and the browser won't
crash. A future CL will stop the add to shelf functionality from being
exposed if extensions are disabled by policy.

BUG=545541

Review URL: https://codereview.chromium.org/1424663005

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#356231}

axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk