Fix race conditions in window snapshot code.

Use LatencyInfo to track when a rendered frame reaches the screen.
Only tested so far on Linux with single-threaded compositor. Must be
tested with Telemetry's GpuTabTest.testScreenshot test on all of
Windows, Mac and Linux with the compositor disabled, enabled and
single-threaded, and enabled and multi-threaded.

BUG=256848

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228652 0039d316-1c4b-4281-b951-d872f2087c98
Terminate Chrome when App Launcher is dismissed. (Mac)

This moves the code that terminates Chrome if no browser window was ever
opened from ExtensionAppShimHandler to AppShimHandlerRegistry.

Chrome is now only terminated if the app list is not visible.

AppListServiceMac calls AppShimHandler::MaybeTerminate when dismissing
the app list.

BUG=256723
TEST=Show the app list by clicking the App Launcher app.
Dismiss it by clicking the App Launcher again, or focusing another window.
Chrome should quit.
TEST=Show the app list and go to Settings.
Switch the profile in the settings page.
The app list should re-show with the new profile.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228653 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 228652
SVN changes up to revision 228653
Factor out [min|max]_size into ShellWindow::SizeConstraints

This encapsulates the logic for managing window size constraints.

BUG=305477

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228654 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 228654