[win8] Force browsers created while Chrome is in Metro mode to be on the Ash desktop.

When a user has configured Chrome to run in Metro mode, all browser
windows should open in the Ash desktop, regardless of where the request
came from. This includes browser desktop shortcuts, v1 browser-hosted
apps, OAuth windows, links from packaged apps, and DevTools windows.
Currently there are many code paths that result in a browser created in
Windows Desktop mode.

Also, if a browser is created in Ash, Metro mode does not always
activate. This may cause a user to think no window was created.

This CL adds BrowserWindow::AdjustHostDesktopType(..) to represent the
current policy decision that browser windows should only open on the Ash
desktop on Windows, when Chrome is running in Metro mode.

The policy is enforced by ensuring all constructed Browser instances are
created with a verified host desktop, which will be TYPE_ASH whenever the
ash shell is instantiated on Windows.

Then, when a browser window gains focus in the Ash desktop, if the metro
viewer process is not already the foreground window, switch to Metro
mode.

BUG=315385, 315894, 319173
TEST=Have Chrome configured in Metro mode. Then:
1. Open Chrome via the Desktop mode App Launcher.
2. Open Chrome via the context menu on the Chrome icon on the Desktop
mode App Launcher.
3. Open Chrome with a profile-badged desktop shortcut (twice).
4. (in Metro Mode) open an undocked Inspector window.
5. Open a v1 hosted app (e.g. Drive) from the Desktop mode app launcher.
6. After showing the Desktop app launcher and closing it, open a v1
hosted app desktop shortcut
===> All of these should open windows in Ash, and switch to Metro mode.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235906 0039d316-1c4b-4281-b951-d872f2087c98
20 files changed