|
|
Chromium Code Reviews
DescriptionFix bugs in the display notification
Bugs resulting from assuming only two displays:
- showing the wrong display name when 2 or more external displays are
connected.
- Showing the wrong message when 2 or more external displays are connected
and the internal display is not the primary, and the lid is closed.
- Handling special cases when mirror, unified, and docked mode enters or exits.
BUG=676821
TEST=ash_unittests --gtest_filter=ScreenLayoutObserverTest.*
Review-Url: https://codereview.chromium.org/2644593003
Cr-Commit-Position: refs/heads/master@{#447335}
Committed: https://chromium.googlesource.com/chromium/src/+/9eacb4506c2ab9569430df9f2450a8f695ef9c4d
Patch Set 1 #Patch Set 2 : [WIP] Fixed test, and added 4 more test stories. #Patch Set 3 : Adding 2 more test stories #
Total comments: 6
Patch Set 4 : Oshima's comments #
Total comments: 5
Patch Set 5 : Oshima's comments #
Total comments: 5
Patch Set 6 : Oshima's comments #
Total comments: 4
Patch Set 7 : Nit #
Messages
Total messages: 39 (26 generated)
The CQ bit was checked by afakhry@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...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by afakhry@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...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== [WIP]: Fix bugs in the display notification BUG=676821 ========== to ========== Fix bugs in the display notification Bugs resulting from assuming only two displays: - showing the wrong display name when 2 or more external displays are connected. - Showing the wrong message when 2 or more external displays are connected and the internal display is not the primary, and the lid is closed. - Handling special cases when mirror, unified, and docked mode enters or exits. BUG=676821 TEST=ash_unittests --gtest_filter=ScreenLayoutObserverTest.* ==========
The CQ bit was checked by afakhry@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...
afakhry@chromium.org changed reviewers: + oshima@chromium.org
Oshima-san, please review this CL. Thank you!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:163: if (out_additional_message) { can this be null? https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:176: base::string16* out_additional_message) { It's better to separate to GetExit/EnterMirrorModeMessage and let caller decide. https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.h (right): https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.h:67: bool current_is_in_unified_mode_ = false; can you use state instead of bools?
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:163: if (out_additional_message) { On 2017/01/24 17:49:41, oshima wrote: > can this be null? No. Replaced with a DCHECK https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:176: base::string16* out_additional_message) { On 2017/01/24 17:49:41, oshima wrote: > It's better to separate to > > GetExit/EnterMirrorModeMessage > > and let caller decide. Done. https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.h (right): https://codereview.chromium.org/2644593003/diff/40001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.h:67: bool current_is_in_unified_mode_ = false; On 2017/01/24 17:49:42, oshima wrote: > can you use state instead of bools? Done.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:187: !display_manager->IsInUnifiedMode()) { can you pass old state instead of testing the condition again here? https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:235: if (display::Display::IsInternalDisplayId(removed_display_info.id())) you can also use the old state. (or DCHECK one of condition)
https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:187: !display_manager->IsInUnifiedMode()) { On 2017/01/25 22:22:26, oshima wrote: > can you pass old state instead of testing the condition again here? Done. Here we need to know if the new state is not unified mode. https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:235: if (display::Display::IsInternalDisplayId(removed_display_info.id())) On 2017/01/25 22:22:26, oshima wrote: > you can also use the old state. (or DCHECK one of condition) I'm sorry, I don't understand what you mean here. Here I'm checking if the removed display is the internal display which means we're going to docked mode. In GetDockedModeEnabledMessage() I DCHECK that IsDockedModeEnabled().
Oshima-san, friendly pingy.
https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/60001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:187: !display_manager->IsInUnifiedMode()) { On 2017/01/26 19:51:09, afakhry wrote: > On 2017/01/25 22:22:26, oshima wrote: > > can you pass old state instead of testing the condition again here? > > Done. Here we need to know if the new state is not unified mode. yes, sorry I meant new state. https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.h (right): https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.h:67: UNIFIED, What I was hoping for is to have explicit state including DOCKED and for >2 case, so that we can split the logic to detect the state, and then decide what to do based on the state transition. Makes sense?
https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:235: if (display::Display::IsInternalDisplayId(removed_display_info.id())) Using two different way to detect docked mode in two places can be confusing. see my comment below. https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:253: // time this function is called). This is the reason why I preferred to have more explicit state, rather than ifs. Is it possible to check docked mode transition in OnDisplayConfigurationChanged and pass it along?
The CQ bit was checked by afakhry@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...
https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:235: if (display::Display::IsInternalDisplayId(removed_display_info.id())) On 2017/01/30 19:28:19, oshima wrote: > Using two different way to detect docked mode in two places can be confusing. > see my comment below. Done. https://codereview.chromium.org/2644593003/diff/80001/ash/system/chromeos/scr... ash/system/chromeos/screen_layout_observer.cc:253: // time this function is called). On 2017/01/30 19:28:19, oshima wrote: > This is the reason why I preferred to have more explicit state, rather than ifs. > Is it possible to check docked mode transition in OnDisplayConfigurationChanged > and pass it along? Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
thanks, lgtm https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... ash/system/chromeos/screen_layout_observer.cc:302: NOTREACHED(); nit: Add log message https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... ash/system/chromeos/screen_layout_observer.cc:405: bool ScreenLayoutObserver::GetExitMirrorModeMessage( or you can just pass current_dispay_mode_, and move this to anonymous namespace. I'll leave it to you.
https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... File ash/system/chromeos/screen_layout_observer.cc (right): https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... ash/system/chromeos/screen_layout_observer.cc:302: NOTREACHED(); On 2017/01/31 17:36:38, oshima wrote: > nit: Add log message Done. https://codereview.chromium.org/2644593003/diff/100001/ash/system/chromeos/sc... ash/system/chromeos/screen_layout_observer.cc:405: bool ScreenLayoutObserver::GetExitMirrorModeMessage( On 2017/01/31 17:36:38, oshima wrote: > or you can just pass current_dispay_mode_, and move this to anonymous namespace. > I'll leave it to you. Moving it to the anonymous namespace will make me expose the DisplayMode enum, and I want to keep it private.
The CQ bit was checked by afakhry@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from oshima@chromium.org Link to the patchset: https://codereview.chromium.org/2644593003/#ps120001 (title: "Nit")
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": 120001, "attempt_start_ts": 1485896388394550,
"parent_rev": "6de347c2112ff05158f32c76547ad7fe37197fe4", "commit_rev":
"9eacb4506c2ab9569430df9f2450a8f695ef9c4d"}
Message was sent while issue was closed.
Description was changed from ========== Fix bugs in the display notification Bugs resulting from assuming only two displays: - showing the wrong display name when 2 or more external displays are connected. - Showing the wrong message when 2 or more external displays are connected and the internal display is not the primary, and the lid is closed. - Handling special cases when mirror, unified, and docked mode enters or exits. BUG=676821 TEST=ash_unittests --gtest_filter=ScreenLayoutObserverTest.* ========== to ========== Fix bugs in the display notification Bugs resulting from assuming only two displays: - showing the wrong display name when 2 or more external displays are connected. - Showing the wrong message when 2 or more external displays are connected and the internal display is not the primary, and the lid is closed. - Handling special cases when mirror, unified, and docked mode enters or exits. BUG=676821 TEST=ash_unittests --gtest_filter=ScreenLayoutObserverTest.* Review-Url: https://codereview.chromium.org/2644593003 Cr-Commit-Position: refs/heads/master@{#447335} Committed: https://chromium.googlesource.com/chromium/src/+/9eacb4506c2ab9569430df9f2450... ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/9eacb4506c2ab9569430df9f2450... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
