Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Issue 58853004: [win8] Force browsers created with Chrome in Metro mode to be on the Ash desktop. (Closed)

Created:
7 years, 1 month ago by tapted
Modified:
7 years, 1 month ago
Reviewers:
Shrikant Kelkar, cpu_(ooo_6.6-7.5), shrikant, sky
CC:
chromium-reviews, tfarina, ben+aura_chromium.org, sadrul, kalyank, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[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. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235906

Patch Set 1 : #ifdef flavour #

Patch Set 2 : platform-specific browser_frame_ash_win #

Patch Set 3 : Use WindowFocused, to catch creation of new tabs as well #

Patch Set 4 : Bots do not seem to care, but try not to break non-CrOS Ash on Linux. Also fix typo. #

Total comments: 12

Patch Set 5 : respond to comments #

Total comments: 6

Patch Set 6 : Move from browser_commands to BrowserWindow #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -63 lines) Patch
M build/filename_rules.gypi View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_window.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_factory.mm View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_frame_ash.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_frame_ash.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
A chrome/browser/ui/views/frame/browser_frame_ashwin.h View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/ui/views/frame/browser_frame_ashwin.cc View 1 2 3 4 1 chunk +35 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/native_browser_frame_factory.h View 1 2 3 4 5 3 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/native_browser_frame_factory.cc View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/native_browser_frame_factory_aura.cc View 1 2 3 4 1 chunk +0 lines, -36 lines 0 comments Download
A chrome/browser/ui/views/frame/native_browser_frame_factory_aurawin.cc View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
A + chrome/browser/ui/views/frame/native_browser_frame_factory_aurax11.cc View 1 2 3 4 1 chunk +3 lines, -18 lines 0 comments Download
A + chrome/browser/ui/views/frame/native_browser_frame_factory_chromeos.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
A chrome/browser/ui/views/frame/native_browser_frame_factory_desktop_ash.cc View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 3 chunks +8 lines, -1 line 0 comments Download
M ui/aura/remote_root_window_host_win.h View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/aura/remote_root_window_host_win.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
tapted
Hi cpu & sky. Please take a look. I think this is the policy we ...
7 years, 1 month ago (2013-11-14 11:38:12 UTC) #1
sky
https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.h File chrome/browser/ui/host_desktop.h (right): https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.h#newcode49 chrome/browser/ui/host_desktop.h:49: HostDesktopType GetVerifiedHostDesktopForBrowser(HostDesktopType desktop_type); This doesn't feel like the right ...
7 years, 1 month ago (2013-11-14 15:28:41 UTC) #2
Shrikant Kelkar
https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.cc File chrome/browser/ui/host_desktop.cc (right): https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.cc#newcode76 chrome/browser/ui/host_desktop.cc:76: return chrome::HOST_DESKTOP_TYPE_ASH; I doubt if this will work when ...
7 years, 1 month ago (2013-11-14 23:54:22 UTC) #3
tapted
(no new code yet - need to ActivateMetroChrome on myself to my slow win8 build/machine, ...
7 years, 1 month ago (2013-11-15 00:11:51 UTC) #4
tapted
https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.h File chrome/browser/ui/host_desktop.h (right): https://codereview.chromium.org/58853004/diff/300001/chrome/browser/ui/host_desktop.h#newcode49 chrome/browser/ui/host_desktop.h:49: HostDesktopType GetVerifiedHostDesktopForBrowser(HostDesktopType desktop_type); On 2013/11/15 00:11:51, tapted wrote: > ...
7 years, 1 month ago (2013-11-15 12:47:11 UTC) #5
sky
https://codereview.chromium.org/58853004/diff/800001/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): https://codereview.chromium.org/58853004/diff/800001/chrome/browser/ui/browser.cc#newcode336 chrome/browser/ui/browser.cc:336: host_desktop_type_(chrome::GetVerifiedHostDesktopForBrowser( Since this is platform specific, how about a ...
7 years, 1 month ago (2013-11-15 17:31:26 UTC) #6
tapted
PTAL https://codereview.chromium.org/58853004/diff/800001/chrome/browser/ui/browser.cc File chrome/browser/ui/browser.cc (right): https://codereview.chromium.org/58853004/diff/800001/chrome/browser/ui/browser.cc#newcode336 chrome/browser/ui/browser.cc:336: host_desktop_type_(chrome::GetVerifiedHostDesktopForBrowser( On 2013/11/15 17:31:27, sky wrote: > Since ...
7 years, 1 month ago (2013-11-18 11:13:47 UTC) #7
sky
LGTM
7 years, 1 month ago (2013-11-18 14:59:04 UTC) #8
tapted
shirkant (or cpu?): does this all look good at a kind of conceptual level? Some ...
7 years, 1 month ago (2013-11-18 22:32:31 UTC) #9
shrikant_google.com
Looks okay to me for now. Given that we want to force single mode (metro ...
7 years, 1 month ago (2013-11-18 23:53:36 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/58853004/1040001
7 years, 1 month ago (2013-11-19 00:45:18 UTC) #11
commit-bot: I haz the power
7 years, 1 month ago (2013-11-19 04:00:44 UTC) #12
Message was sent while issue was closed.
Change committed as 235906

Powered by Google App Engine
This is Rietveld 408576698