|
|
Chromium Code Reviews|
Created:
4 years ago by Qiang(Joe) Xu Modified:
3 years, 10 months ago CC:
chromium-reviews, kalyank, sadrul Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's
Changes:
Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840.
For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this.
We want to get browser that has active window associated with it, return nullptr if that doesn't exist.
BUG=675265
TEST=emulator tests see bug 675265 fixed; a test coverage is added:
MultiUserWindowManagerChromeOSTest.GetActiveBrowserTest
Review-Url: https://codereview.chromium.org/2599833003
Cr-Commit-Position: refs/heads/master@{#447830}
Committed: https://chromium.googlesource.com/chromium/src/+/ffd4c0625973c223ef7dbcab19caf00a7729f399
Patch Set 1 #Patch Set 2 : GetActiveBrowserOnActiveDesktop #Patch Set 3 : FindLastActive in browser_finder #Patch Set 4 : get active browser with active browser window #
Total comments: 2
Patch Set 5 : add test coverage #
Messages
Total messages: 45 (29 generated)
The CQ bit was checked by warx@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Fix ctrl+n new windows are opened in wrong user profile on ChromeOS BUG=675265 ========== to ========== Fix ctrl+n new windows are opened in wrong user profile on ChromeOS Changes: The original code does not work for the reporter's bug, as far as there is a browser in another non-active profile. BUG=675265 TEST=emulator tests see bug fixed ==========
warx@chromium.org changed reviewers: + stevenjb@chromium.org
Hi Steven, ptal, thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
stevenjb@chromium.org changed reviewers: + oshima@chromium.org, xdai@chromium.org
This was an intentional change: https://codereview.chromium.org/1954853002 -> xdai@, oshima@ who made/reviewed that change. blame is here: https://chromium.googlesource.com/chromium/src/+blame/master/chrome/browser/u... Which can be found from the 'git blame' entry in 'view in' dropdown in code search: https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/chrome_new_window_...
With your change in place, does it affect the behavior of the original issue 608840?
On 2016/12/28 18:03:50, xdai1 wrote: > With your change in place, does it affect the behavior of the original issue > 608840? This will most likely break 608840. I think the correct fix is something like. 1) get active window 2) if there is no active window, use the active user profile 3) get the browser window for this active window 4) if there is no browser window for the active window, then use the active user profile. 5) use the profile of the active browser window. Also, could you please add unit tests for this?
On 2017/01/05 20:57:51, oshima wrote: > On 2016/12/28 18:03:50, xdai1 wrote: > > With your change in place, does it affect the behavior of the original issue > > 608840? > > This will most likely break 608840. I think the correct fix is something like. > > 1) get active window > 2) if there is no active window, use the active user profile > 3) get the browser window for this active window > 4) if there is no browser window for the active window, then use the active user > profile. > 5) use the profile of the active browser window. > > Also, could you please add unit tests for this? update: 608840 will be addressed in https://codereview.chromium.org/2644733004/. Once that is done, oshima's suggestion can fix 675265 under this issue.
Description was changed from ========== Fix ctrl+n new windows are opened in wrong user profile on ChromeOS Changes: The original code does not work for the reporter's bug, as far as there is a browser in another non-active profile. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004 where chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) is replaced with BrowserList::GetInstance()->GetLastActive(). https://codereview.chromium.org/2434463004 is taking effort to separate ash/ from chrome/. In ash::wm::GetActiveWindow, ash::Shell::GetPrimaryRootWindow still has dependency on ash/. In this cl, multi_user_util::IsProfileFromActiveUser is used to check if the last active browser is from active user's desktop or not on chromeos. BUG=675265 TEST=emulator tests see bug fixed ==========
Patchset #2 (id:20001) has been deleted
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004 where chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) is replaced with BrowserList::GetInstance()->GetLastActive(). https://codereview.chromium.org/2434463004 is taking effort to separate ash/ from chrome/. In ash::wm::GetActiveWindow, ash::Shell::GetPrimaryRootWindow still has dependency on ash/. In this cl, multi_user_util::IsProfileFromActiveUser is used to check if the last active browser is from active user's desktop or not on chromeos. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. multi_user_util::GetProfileFromWindow(aura::Window*) can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. BUG=675265 TEST=emulator tests see bug fixed ==========
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. multi_user_util::GetProfileFromWindow(aura::Window*) can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. multi_user_util::GetProfileFromWindow(aura::Window*) can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. If that is the other non-active desktop, we think there is no active browser. BUG=675265 TEST=emulator tests see bug fixed ==========
Hi all, ptal, thanks! I updated the description, please have a check. Even I restored chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()), it cannot fix crbug.com/608840. This cl is to find a way to fix BrowserList::GetInstance()->GetLastActive() for multi-profile chromeos use case. I am still working on the test coverage, but sending out for review firstly.
The CQ bit was checked by warx@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. multi_user_util::GetProfileFromWindow(aura::Window*) can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. If that is the other non-active desktop, we think there is no active browser. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. GetShownProfileForBrowser can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. If that is the other non-active desktop, we think there is no active browser. BUG=675265 TEST=emulator tests see bug fixed ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
warx@chromium.org changed reviewers: + sky@chromium.org - stevenjb@chromium.org
warx@chromium.org changed reviewers: - sky@chromium.org
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. GetShownProfileForBrowser can return profile that the given window is shown on. Then compare with ProfileManager::GetActiveUserProfile(), we could know if BrowserList::GetInstance()->GetLastActive() is returning a browser on active desktop or the other non-active desktop. If that is the other non-active desktop, we think there is no active browser. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. BUG=675265 TEST=emulator tests see bug fixed ==========
Hi all, ptal, thanks!
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug fixed ==========
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug fixed ========== to ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed ==========
Description was changed from ========== ChromeOS: Fix NewWindow's bug when active browser is on other user's desktop Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed ========== to ========== ChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed ==========
thanks, can you add unit test?
https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... File chrome/browser/ui/ash/chrome_new_window_client.cc (right): https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... chrome/browser/ui/ash/chrome_new_window_client.cc:51: aura::client::ActivationClient* client = nit: include activation_client.h
warx@chromium.org changed reviewers: + skuhne@chromium.org
+Stefan in reviewers, Besides the email I sent last Friday, I find this is a long term issue (crbug.com/230464) and a TODO here: https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/launcher/chrome_la.... I still have no idea about how to write such tests. Let us talk offline tmr. Thanks! https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... File chrome/browser/ui/ash/chrome_new_window_client.cc (right): https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... chrome/browser/ui/ash/chrome_new_window_client.cc:51: aura::client::ActivationClient* client = On 2017/01/30 18:09:24, oshima wrote: > nit: include activation_client.h It is added in this patch.
On 2017/01/31 06:55:55, Qiang(Joe) Xu wrote: > +Stefan in reviewers, > > Besides the email I sent last Friday, I find this is a long term issue > (crbug.com/230464) and a TODO here: > https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/launcher/chrome_la.... > > I still have no idea about how to write such tests. Let us talk offline tmr. > Thanks! Can you add test here? https://cs.chromium.org/chromium/src/chrome/browser/ui/ash/multi_user/multi_u... > > https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... > File chrome/browser/ui/ash/chrome_new_window_client.cc (right): > > https://codereview.chromium.org/2599833003/diff/80001/chrome/browser/ui/ash/c... > chrome/browser/ui/ash/chrome_new_window_client.cc:51: > aura::client::ActivationClient* client = > On 2017/01/30 18:09:24, oshima wrote: > > nit: include activation_client.h > > It is added in this patch.
Patchset #5 (id:100001) has been deleted
Patchset #5 (id:120001) has been deleted
Description was changed from ========== ChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed ========== to ========== ChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed; a test coverage is added: MultiUserWindowManagerChromeOSTest.GetActiveBrowserTest ==========
Hi all, test coverage is added, ptal, thanks!
lgtm thanks!
lgtm
The CQ bit was checked by warx@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 140001, "attempt_start_ts": 1486065176424010,
"parent_rev": "b84904d4fca3baf6a1f348dfe94a0e34c39ac903", "commit_rev":
"ffd4c0625973c223ef7dbcab19caf00a7729f399"}
Message was sent while issue was closed.
Description was changed from ========== ChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed; a test coverage is added: MultiUserWindowManagerChromeOSTest.GetActiveBrowserTest ========== to ========== ChromeOS: Fix NewWindow's bug with browser on other user's desktop and no browser on current's Changes: Regression comes from https://codereview.chromium.org/2434463004. The CL introduces two regressions, one for crbug.com/675265, one for crbug.com/608840. For crbug.com/675265, regression comes from changing chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()) to BrowserList::GetInstance()->GetLastActive(). ash::wm::GetActiveWindow() makes sure that GetActiveWindow from primary root window, however, it has dependency on ash/. This CL is to fix this. We want to get browser that has active window associated with it, return nullptr if that doesn't exist. BUG=675265 TEST=emulator tests see bug 675265 fixed; a test coverage is added: MultiUserWindowManagerChromeOSTest.GetActiveBrowserTest Review-Url: https://codereview.chromium.org/2599833003 Cr-Commit-Position: refs/heads/master@{#447830} Committed: https://chromium.googlesource.com/chromium/src/+/ffd4c0625973c223ef7dbcab19ca... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:140001) as https://chromium.googlesource.com/chromium/src/+/ffd4c0625973c223ef7dbcab19ca... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
