|
|
DescriptionIf force-sign-in policy is enabled, popup warning dialog before window closing if auth token become invalid.
Screenshots:
https://goo.gl/photos/3KiQsSAPTse5brR89
https://goo.gl/photos/1jdyC86dSSyZVdi8A
BUG=642059
Review-Url: https://codereview.chromium.org/2862653002
Cr-Commit-Position: refs/heads/master@{#478124}
Committed: https://chromium.googlesource.com/chromium/src/+/4dc68137b9724480cf6e055d24cbff75458a114e
Patch Set 1 #Patch Set 2 : fixup #
Total comments: 45
Patch Set 3 : sky's comments, without browsertest update #Patch Set 4 : update browser test #Patch Set 5 : fix #Patch Set 6 : remove app_modal:: #
Total comments: 1
Patch Set 7 : fixup and rebase from master #
Total comments: 1
Patch Set 8 : refactor #
Total comments: 10
Patch Set 9 : cr #
Total comments: 41
Patch Set 10 : cr and rebase from master #
Total comments: 4
Patch Set 11 : UX update #
Total comments: 36
Patch Set 12 : cr #Patch Set 13 : rename #Patch Set 14 : remove timer #
Total comments: 6
Patch Set 15 : cr #
Total comments: 2
Patch Set 16 : nit #Messages
Total messages: 142 (98 generated)
zmin@chromium.org changed reviewers: + sky@chromium.org
Hi sky, Could you take a look this CL please? Owen
The CQ bit was checked by zmin@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: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by zmin@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_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by zmin@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_...)
Patchset #2 (id:40001) has been deleted
The CQ bit was checked by zmin@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: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #2 (id:60001) has been deleted
The CQ bit was checked by zmin@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.
https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... File chrome/app/chromium_strings.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:761: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_CONFIRM" desc="Text of the button to cofirm close all browser window"> cofirm->confirm window->windows https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:764: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_EXPLANATION" desc="Text of the reason of sign out"> 'of sign out' -> 'to sign out' https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:767: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_EXPLANATION_WITHOUT_USER_NAME" desc="Text of the reason of sign out when there is no valid email address"> 'of sign' -> 'to sign' https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... chrome/app/generated_resources.grd:8234: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_TITLE" desc="The title of the dialog to notift brower window closing when force sign in is enabled and local auth info is not valid."> The title of the dialog shown when the user closes a browser when and force sig... https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... chrome/app/generated_resources.grd:8237: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_DELAY" desc="Text of the button to delay close all browser window"> close->closing https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... File chrome/app/google_chrome_strings.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... chrome/app/google_chrome_strings.grd:769: Authentication certificate failed. Please sign in to Google Chrome again as <ph name="USER_NAME">$2<ex>pat@example.com</ex></ph> or contact your administrator for more inforamtion. <ph name="ADDITIONAL_EXPLANATION">$3</ph> information https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... chrome/app/google_chrome_strings.grd:772: Authentication certificate failed. Please sign in to Google Chrome again or contact your administrator for more inforamtion. <ph name="ADDITIONAL_EXPLANATION">$2</ph> information https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/signin/f... File chrome/browser/signin/force_signout_timer.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/signin/f... chrome/browser/signin/force_signout_timer.h:8: class ForceSignoutTimer { Can you elaborate on why you need a class for this instead of using OneShotTimer directly? If it's because you *might* need additional logic, please wait until then. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:32: if (web_contents == nullptr) This should be a DCHECK. You earlier check the size, an the only way there is no active web contents is if there are no tabs. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { How about naming this IsMatchingBrowser and include the tab_strip_model check here too? Two questions on the implementation: . Do you really want to incognito windows here? It seems weird to anchor to an incognito window? . Are you sure you don't want to look at the type? Anchoring to popups could be weird. . Don't you want to check visibility of the window? https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : app_modal::AppModalDialog( Why are you using app_modal_dialog here? I understand that you want app modal, but you needn't use the AppModal class for that. Using the Appmodal class ties you to WebContents, which I'm not sure you want. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.h:21: // A app modal dialog that display the warning message of the auth failure An app modal dialog that displays a warning message of auth failure before signing the user out and closing all browser windows. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.h:50: }; DISALLOW... https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:17: class ForceSignoutDialogBrowserTest : public InProcessBrowserTest {}; This code should follow the details here: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/testin... . https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_view.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:29: constrained_window::CreateBrowserModalDialogViews( Can you elaborate on why you want a constrained window here? https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:70: const ViewHierarchyChangedDetails& details) { Can this go in AddedToWidget? https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:75: const SkColor kPromptBarBackgroundColor = GetSigninConfirmationPromptBarColor( kFoo style is for compile time constants. This isn't a compile time constant. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:123: dialog_layout->SetInsets(views::kPanelVertMargin, 0, 0, 0); Please use the LayoutProvider constants where appropriate. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:164: void ForceSignoutDialogView::ActivateAppModalDialog() { newline between functions. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_view.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.h:22: bool Accept() override; Prefix where overrides come from, e.g.: // DialogDelegateView. https://codereview.chromium.org/2862653002/diff/80001/chrome/test/BUILD.gn File chrome/test/BUILD.gn (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/test/BUILD.gn#ne... chrome/test/BUILD.gn:2015: sources += [ "../browser/ui/views/profiles/force_signout_dialog_browsertest.cc" ] Are you sure you want this for mac too?
The CQ bit was checked by zmin@chromium.org to run a CQ dry run
https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... File chrome/app/chromium_strings.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:761: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_CONFIRM" desc="Text of the button to cofirm close all browser window"> On 2017/05/04 03:45:11, sky wrote: > cofirm->confirm > window->windows Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:764: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_EXPLANATION" desc="Text of the reason of sign out"> On 2017/05/04 03:45:11, sky wrote: > 'of sign out' -> 'to sign out' Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/chromium_str... chrome/app/chromium_strings.grd:767: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_EXPLANATION_WITHOUT_USER_NAME" desc="Text of the reason of sign out when there is no valid email address"> On 2017/05/04 03:45:11, sky wrote: > 'of sign' -> 'to sign' Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... chrome/app/generated_resources.grd:8234: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_TITLE" desc="The title of the dialog to notift brower window closing when force sign in is enabled and local auth info is not valid."> On 2017/05/04 03:45:11, sky wrote: > The title of the dialog shown when the user closes a browser when and force > sig... Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/generated_re... chrome/app/generated_resources.grd:8237: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_DELAY" desc="Text of the button to delay close all browser window"> On 2017/05/04 03:45:11, sky wrote: > close->closing Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... File chrome/app/google_chrome_strings.grd (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... chrome/app/google_chrome_strings.grd:769: Authentication certificate failed. Please sign in to Google Chrome again as <ph name="USER_NAME">$2<ex>pat@example.com</ex></ph> or contact your administrator for more inforamtion. <ph name="ADDITIONAL_EXPLANATION">$3</ph> On 2017/05/04 03:45:11, sky wrote: > information Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/app/google_chrom... chrome/app/google_chrome_strings.grd:772: Authentication certificate failed. Please sign in to Google Chrome again or contact your administrator for more inforamtion. <ph name="ADDITIONAL_EXPLANATION">$2</ph> On 2017/05/04 03:45:11, sky wrote: > information Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/signin/f... File chrome/browser/signin/force_signout_timer.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/signin/f... chrome/browser/signin/force_signout_timer.h:8: class ForceSignoutTimer { On 2017/05/04 03:45:11, sky wrote: > Can you elaborate on why you need a class for this instead of using OneShotTimer > directly? If it's because you *might* need additional logic, please wait until > then. Ok, So i change it to a closure https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:32: if (web_contents == nullptr) On 2017/05/04 03:45:11, sky wrote: > This should be a DCHECK. You earlier check the size, an the only way there is no > active web contents is if there are no tabs. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { On 2017/05/04 03:45:11, sky wrote: > How about naming this IsMatchingBrowser and include the tab_strip_model check > here too? Done. Two questions on the implementation: > . Do you really want to incognito windows here? It seems weird to anchor to an > incognito window? > . Are you sure you don't want to look at the type? Anchoring to popups could be > weird. > . Don't you want to check visibility of the window? The purpose the dialog is warning the window closing. So Visibility, yes I'll check the visibility. it seems no harm to close if all windows are invisible. Incognito and popups. I agree it's kinda weird. But since they will be closed later as well, I think it make sense to show the warning msg before. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : app_modal::AppModalDialog( On 2017/05/04 03:45:11, sky wrote: > Why are you using app_modal_dialog here? I understand that you want app modal, > but you needn't use the AppModal class for that. Using the Appmodal class ties > you to WebContents, which I'm not sure you want. No, I don't want to be tied to WebContents. However, what i want is this: https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_vi... It prevent user open other browser window when the dialog is being displayed. And right now I only found AppModalDialog class can do so with AppModalDialogQueue. User can still use other chrome window when a normal window modal dialog is opened. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.h:21: // A app modal dialog that display the warning message of the auth failure On 2017/05/04 03:45:11, sky wrote: > An app modal dialog that displays a warning message of auth failure before > signing the user out and closing all browser windows. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.h:50: }; On 2017/05/04 03:45:11, sky wrote: > DISALLOW... Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:17: class ForceSignoutDialogBrowserTest : public InProcessBrowserTest {}; On 2017/05/04 03:45:11, sky wrote: > This code should follow the details here: > https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/testin... > . Will do https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_view.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:29: constrained_window::CreateBrowserModalDialogViews( On 2017/05/04 03:45:12, sky wrote: > Can you elaborate on why you want a constrained window here? I use constrained window as I found other modal dialog is using it. Should I avoid to do so if possible? https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:70: const ViewHierarchyChangedDetails& details) { On 2017/05/04 03:45:12, sky wrote: > Can this go in AddedToWidget? Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:75: const SkColor kPromptBarBackgroundColor = GetSigninConfirmationPromptBarColor( On 2017/05/04 03:45:12, sky wrote: > kFoo style is for compile time constants. This isn't a compile time constant. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:123: dialog_layout->SetInsets(views::kPanelVertMargin, 0, 0, 0); On 2017/05/04 03:45:11, sky wrote: > Please use the LayoutProvider constants where appropriate. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.cc:164: void ForceSignoutDialogView::ActivateAppModalDialog() { On 2017/05/04 03:45:12, sky wrote: > newline between functions. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog_view.h (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog_view.h:22: bool Accept() override; On 2017/05/04 03:45:12, sky wrote: > Prefix where overrides come from, e.g.: > // DialogDelegateView. Done. https://codereview.chromium.org/2862653002/diff/80001/chrome/test/BUILD.gn File chrome/test/BUILD.gn (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/test/BUILD.gn#ne... chrome/test/BUILD.gn:2015: sources += [ "../browser/ui/views/profiles/force_signout_dialog_browsertest.cc" ] On 2017/05/04 03:45:12, sky wrote: > Are you sure you want this for mac too? I thought toolkit_view modal dialog has been supported on mac recently. I'll test it on Mac and remove it from mac if it doesn't work.
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: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { On 2017/05/04 23:13:52, zmin wrote: > On 2017/05/04 03:45:11, sky wrote: > > How about naming this IsMatchingBrowser and include the tab_strip_model check > > here too? > Done. > Two questions on the implementation: > > . Do you really want to incognito windows here? It seems weird to anchor to an > > incognito window? > > . Are you sure you don't want to look at the type? Anchoring to popups could > be > > weird. > > . Don't you want to check visibility of the window? > > The purpose the dialog is warning the window closing. So > Visibility, yes I'll check the visibility. it seems no harm to close if all > windows are invisible. Be careful there. You should verify you get the right thing if the window is minimized. I would say in that case you should force the window to be shown and then show the dialog. > Incognito and popups. I agree it's kinda weird. But since they will be closed > later as well, I think it make sense to show the warning msg before. https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : app_modal::AppModalDialog( On 2017/05/04 23:13:52, zmin wrote: > On 2017/05/04 03:45:11, sky wrote: > > Why are you using app_modal_dialog here? I understand that you want app modal, > > but you needn't use the AppModal class for that. Using the Appmodal class ties > > you to WebContents, which I'm not sure you want. > > No, I don't want to be tied to WebContents. However, what i want is this: > https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_vi... > It prevent user open other browser window when the dialog is being displayed. > And right now I only found AppModalDialog class can do so with > AppModalDialogQueue. User can still use other chrome window when a normal window > modal dialog is opened. > Also, user could still interact with non-browser windows in Chrome. Are you sure you want that? https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : app_modal::AppModalDialog( On 2017/05/04 23:13:52, zmin wrote: > On 2017/05/04 03:45:11, sky wrote: > > Why are you using app_modal_dialog here? I understand that you want app modal, > > but you needn't use the AppModal class for that. Using the Appmodal class ties > > you to WebContents, which I'm not sure you want. > > No, I don't want to be tied to WebContents. However, what i want is this: > https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_vi... > It prevent user open other browser window when the dialog is being displayed. > And right now I only found AppModalDialog class can do so with > AppModalDialogQueue. User can still use other chrome window when a normal window > modal dialog is opened. > Also, what happens if the browser you are anchored to ends up closing? This could happen for a number of reasons.
The CQ bit was checked by zmin@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...
I have tested the dialog on Mac. The dialog itself looks good. But it seems that the app modal dialog doesn't block other browser window on Mac. I think it's not what I expected. So i remove Mac support for now. On 2017/05/05 00:00:10, sky wrote: > https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > On 2017/05/04 23:13:52, zmin wrote: > > On 2017/05/04 03:45:11, sky wrote: > > > How about naming this IsMatchingBrowser and include the tab_strip_model > check > > > here too? > > Done. > > Two questions on the implementation: > > > . Do you really want to incognito windows here? It seems weird to anchor to > an > > > incognito window? > > > . Are you sure you don't want to look at the type? Anchoring to popups could > > be > > > weird. > > > . Don't you want to check visibility of the window? > > > > The purpose the dialog is warning the window closing. So > > Visibility, yes I'll check the visibility. it seems no harm to close if all > > windows are invisible. > > Be careful there. You should verify you get the right thing if the window is > minimized. I would say in that case you should force the window to be shown and > then show the dialog. I have tested that, this IsVisible function returns True for a minimized window. > > > Incognito and popups. I agree it's kinda weird. But since they will be closed > > later as well, I think it make sense to show the warning msg before. > > https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > app_modal::AppModalDialog( > On 2017/05/04 23:13:52, zmin wrote: > > On 2017/05/04 03:45:11, sky wrote: > > > Why are you using app_modal_dialog here? I understand that you want app > modal, > > > but you needn't use the AppModal class for that. Using the Appmodal class > ties > > > you to WebContents, which I'm not sure you want. > > > > No, I don't want to be tied to WebContents. However, what i want is this: > > > https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_vi... > > It prevent user open other browser window when the dialog is being displayed. > > And right now I only found AppModalDialog class can do so with > > AppModalDialogQueue. User can still use other chrome window when a normal > window > > modal dialog is opened. > > > > Also, user could still interact with non-browser windows in Chrome. Are you sure > you want that? Yes, I think it's good enough. I don't think it's necessary to block a non-browser window because user can't use them to browser the internet. > > https://codereview.chromium.org/2862653002/diff/80001/chrome/browser/ui/views... > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > app_modal::AppModalDialog( > On 2017/05/04 23:13:52, zmin wrote: > > On 2017/05/04 03:45:11, sky wrote: > > > Why are you using app_modal_dialog here? I understand that you want app > modal, > > > but you needn't use the AppModal class for that. Using the Appmodal class > ties > > > you to WebContents, which I'm not sure you want. > > > > No, I don't want to be tied to WebContents. However, what i want is this: > > > https://cs.chromium.org/chromium/src/chrome/browser/ui/views/frame/browser_vi... > > It prevent user open other browser window when the dialog is being displayed. > > And right now I only found AppModalDialog class can do so with > > AppModalDialogQueue. User can still use other chrome window when a normal > window > > modal dialog is opened. > > > > Also, what happens if the browser you are anchored to ends up closing? This > could happen for a number of reasons. In general, there is always a default behavior(cancel) when dialog is closed. Because the dialog instance is stored in the browser process. So i guess it will always block all browser windows unless the browser process is terminated. In which cases, it doesn't matter anyway.
Sorry to ask this now, but is there a design doc for this? I'm wondering why we are trying to block usage at all instead of presenting the warning timer and forcing closing if the timer expires? On Fri, May 5, 2017 at 3:22 PM, <zmin@chromium.org> wrote: > I have tested the dialog on Mac. The dialog itself looks good. But it > seems that > the app modal dialog doesn't block other browser window on Mac. > > I think it's not what I expected. So i remove Mac support for now. > > > On 2017/05/05 00:00:10, sky wrote: > > > https://codereview.chromium.org/2862653002/diff/80001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode38 > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool > > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > > On 2017/05/04 23:13:52, zmin wrote: > > > On 2017/05/04 03:45:11, sky wrote: > > > > How about naming this IsMatchingBrowser and include the > tab_strip_model > > check > > > > here too? > > > Done. > > > Two questions on the implementation: > > > > . Do you really want to incognito windows here? It seems weird to > anchor > to > > an > > > > incognito window? > > > > . Are you sure you don't want to look at the type? Anchoring to > popups > could > > > be > > > > weird. > > > > . Don't you want to check visibility of the window? > > > > > > The purpose the dialog is warning the window closing. So > > > Visibility, yes I'll check the visibility. it seems no harm to close > if all > > > windows are invisible. > > > > Be careful there. You should verify you get the right thing if the > window is > > minimized. I would say in that case you should force the window to be > shown > and > > then show the dialog. > > I have tested that, this IsVisible function returns True for a minimized > window. > > > > > > Incognito and popups. I agree it's kinda weird. But since they will be > closed > > > later as well, I think it make sense to show the warning msg before. > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > app_modal::AppModalDialog( > > On 2017/05/04 23:13:52, zmin wrote: > > > On 2017/05/04 03:45:11, sky wrote: > > > > Why are you using app_modal_dialog here? I understand that you want > app > > modal, > > > > but you needn't use the AppModal class for that. Using the Appmodal > class > > ties > > > > you to WebContents, which I'm not sure you want. > > > > > > No, I don't want to be tied to WebContents. However, what i want is > this: > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > It prevent user open other browser window when the dialog is being > displayed. > > > And right now I only found AppModalDialog class can do so with > > > AppModalDialogQueue. User can still use other chrome window when a > normal > > window > > > modal dialog is opened. > > > > > > > Also, user could still interact with non-browser windows in Chrome. Are > you > sure > > you want that? > > Yes, I think it's good enough. I don't think it's necessary to block a > non-browser window because user can't use them to browser the internet. > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > app_modal::AppModalDialog( > > On 2017/05/04 23:13:52, zmin wrote: > > > On 2017/05/04 03:45:11, sky wrote: > > > > Why are you using app_modal_dialog here? I understand that you want > app > > modal, > > > > but you needn't use the AppModal class for that. Using the Appmodal > class > > ties > > > > you to WebContents, which I'm not sure you want. > > > > > > No, I don't want to be tied to WebContents. However, what i want is > this: > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > It prevent user open other browser window when the dialog is being > displayed. > > > And right now I only found AppModalDialog class can do so with > > > AppModalDialogQueue. User can still use other chrome window when a > normal > > window > > > modal dialog is opened. > > > > > > > Also, what happens if the browser you are anchored to ends up closing? > This > > could happen for a number of reasons. > > In general, there is always a default behavior(cancel) when dialog is > closed. > Because the dialog instance is stored in the browser process. So i guess > it will > always block all browser windows unless the browser process is terminated. > In > which cases, it doesn't matter anyway. > > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2017/05/05 22:32:20, sky wrote: > Sorry to ask this now, but is there a design doc for this? I'm wondering > why we are trying to block usage at all instead of presenting the warning > timer and forcing closing if the timer expires? Yes: https://docs.google.com/document/d/1cfDuV6n7puoWV2cMVI_LXlY8TOh1_jNulVPHyGjXW... User may leave his or her desk when the dialog is poped. That's why the timer is started only after the dialog is confirmed/canceled. > On Fri, May 5, 2017 at 3:22 PM, <mailto:zmin@chromium.org> wrote: > > > I have tested the dialog on Mac. The dialog itself looks good. But it > > seems that > > the app modal dialog doesn't block other browser window on Mac. > > > > I think it's not what I expected. So i remove Mac support for now. > > > > > > On 2017/05/05 00:00:10, sky wrote: > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode38 > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool > > > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > > > On 2017/05/04 23:13:52, zmin wrote: > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > How about naming this IsMatchingBrowser and include the > > tab_strip_model > > > check > > > > > here too? > > > > Done. > > > > Two questions on the implementation: > > > > > . Do you really want to incognito windows here? It seems weird to > > anchor > > to > > > an > > > > > incognito window? > > > > > . Are you sure you don't want to look at the type? Anchoring to > > popups > > could > > > > be > > > > > weird. > > > > > . Don't you want to check visibility of the window? > > > > > > > > The purpose the dialog is warning the window closing. So > > > > Visibility, yes I'll check the visibility. it seems no harm to close > > if all > > > > windows are invisible. > > > > > > Be careful there. You should verify you get the right thing if the > > window is > > > minimized. I would say in that case you should force the window to be > > shown > > and > > > then show the dialog. > > > > I have tested that, this IsVisible function returns True for a minimized > > window. > > > > > > > > > Incognito and popups. I agree it's kinda weird. But since they will be > > closed > > > > later as well, I think it make sense to show the warning msg before. > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > app_modal::AppModalDialog( > > > On 2017/05/04 23:13:52, zmin wrote: > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > Why are you using app_modal_dialog here? I understand that you want > > app > > > modal, > > > > > but you needn't use the AppModal class for that. Using the Appmodal > > class > > > ties > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > this: > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > It prevent user open other browser window when the dialog is being > > displayed. > > > > And right now I only found AppModalDialog class can do so with > > > > AppModalDialogQueue. User can still use other chrome window when a > > normal > > > window > > > > modal dialog is opened. > > > > > > > > > > Also, user could still interact with non-browser windows in Chrome. Are > > you > > sure > > > you want that? > > > > Yes, I think it's good enough. I don't think it's necessary to block a > > non-browser window because user can't use them to browser the internet. > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > app_modal::AppModalDialog( > > > On 2017/05/04 23:13:52, zmin wrote: > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > Why are you using app_modal_dialog here? I understand that you want > > app > > > modal, > > > > > but you needn't use the AppModal class for that. Using the Appmodal > > class > > > ties > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > this: > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > It prevent user open other browser window when the dialog is being > > displayed. > > > > And right now I only found AppModalDialog class can do so with > > > > AppModalDialogQueue. User can still use other chrome window when a > > normal > > > window > > > > modal dialog is opened. > > > > > > > > > > Also, what happens if the browser you are anchored to ends up closing? > > This > > > could happen for a number of reasons. > > > > In general, there is always a default behavior(cancel) when dialog is > > closed. > > Because the dialog instance is stored in the browser process. So i guess > > it will > > always block all browser windows unless the browser process is terminated. > > In > > which cases, it doesn't matter anyway. > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org.
Thanks! So, I think if you want true app-modal you need to use another mechanism. The mechanism you are using here is not necessarily app modal. It's only modal against browsers. For examples, apps don't hit the code path you mentioned. -Scott On Fri, May 5, 2017 at 3:42 PM, <zmin@chromium.org> wrote: > On 2017/05/05 22:32:20, sky wrote: > > Sorry to ask this now, but is there a design doc for this? I'm wondering > > why we are trying to block usage at all instead of presenting the warning > > timer and forcing closing if the timer expires? > Yes: > https://docs.google.com/document/d/1cfDuV6n7puoWV2cMVI_LXlY8TOh1_ > jNulVPHyGjXW94/edit#heading=h.id227xaj6wxy > > User may leave his or her desk when the dialog is poped. That's why the > timer is > started only after the dialog is confirmed/canceled. > > > > > On Fri, May 5, 2017 at 3:22 PM, <mailto:zmin@chromium.org> wrote: > > > > > I have tested the dialog on Mac. The dialog itself looks good. But it > > > seems that > > > the app modal dialog doesn't block other browser window on Mac. > > > > > > I think it's not what I expected. So i remove Mac support for now. > > > > > > > > > On 2017/05/05 00:00:10, sky wrote: > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc > (right): > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode38 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool > > > > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > How about naming this IsMatchingBrowser and include the > > > tab_strip_model > > > > check > > > > > > here too? > > > > > Done. > > > > > Two questions on the implementation: > > > > > > . Do you really want to incognito windows here? It seems weird to > > > anchor > > > to > > > > an > > > > > > incognito window? > > > > > > . Are you sure you don't want to look at the type? Anchoring to > > > popups > > > could > > > > > be > > > > > > weird. > > > > > > . Don't you want to check visibility of the window? > > > > > > > > > > The purpose the dialog is warning the window closing. So > > > > > Visibility, yes I'll check the visibility. it seems no harm to > close > > > if all > > > > > windows are invisible. > > > > > > > > Be careful there. You should verify you get the right thing if the > > > window is > > > > minimized. I would say in that case you should force the window to be > > > shown > > > and > > > > then show the dialog. > > > > > > I have tested that, this IsVisible function returns True for a > minimized > > > window. > > > > > > > > > > > > Incognito and popups. I agree it's kinda weird. But since they > will be > > > closed > > > > > later as well, I think it make sense to show the warning msg > before. > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > app_modal::AppModalDialog( > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > Why are you using app_modal_dialog here? I understand that you > want > > > app > > > > modal, > > > > > > but you needn't use the AppModal class for that. Using the > Appmodal > > > class > > > > ties > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > > this: > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > It prevent user open other browser window when the dialog is being > > > displayed. > > > > > And right now I only found AppModalDialog class can do so with > > > > > AppModalDialogQueue. User can still use other chrome window when a > > > normal > > > > window > > > > > modal dialog is opened. > > > > > > > > > > > > > Also, user could still interact with non-browser windows in Chrome. > Are > > > you > > > sure > > > > you want that? > > > > > > Yes, I think it's good enough. I don't think it's necessary to block a > > > non-browser window because user can't use them to browser the internet. > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > app_modal::AppModalDialog( > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > Why are you using app_modal_dialog here? I understand that you > want > > > app > > > > modal, > > > > > > but you needn't use the AppModal class for that. Using the > Appmodal > > > class > > > > ties > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > > this: > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > It prevent user open other browser window when the dialog is being > > > displayed. > > > > > And right now I only found AppModalDialog class can do so with > > > > > AppModalDialogQueue. User can still use other chrome window when a > > > normal > > > > window > > > > > modal dialog is opened. > > > > > > > > > > > > > Also, what happens if the browser you are anchored to ends up > closing? > > > This > > > > could happen for a number of reasons. > > > > > > In general, there is always a default behavior(cancel) when dialog is > > > closed. > > > Because the dialog instance is stored in the browser process. So i > guess > > > it will > > > always block all browser windows unless the browser process is > terminated. > > > In > > > which cases, it doesn't matter anyway. > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Chromium-reviews" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email > > to mailto:chromium-reviews+unsubscribe@chromium.org. > > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Is there any true app-modal dialog in chromium? Because this is the only dialog class I found when search AppModal in chromium. If not, I think it's ok not to block app now. I can use other way to block app if necessary. On 2017/05/05 22:45:08, sky wrote: > Thanks! > So, I think if you want true app-modal you need to use another mechanism. > The mechanism you are using here is not necessarily app modal. It's only > modal against browsers. For examples, apps don't hit the code path you > mentioned. > > -Scott > > On Fri, May 5, 2017 at 3:42 PM, <mailto:zmin@chromium.org> wrote: > > > On 2017/05/05 22:32:20, sky wrote: > > > Sorry to ask this now, but is there a design doc for this? I'm wondering > > > why we are trying to block usage at all instead of presenting the warning > > > timer and forcing closing if the timer expires? > > Yes: > > https://docs.google.com/document/d/1cfDuV6n7puoWV2cMVI_LXlY8TOh1_ > > jNulVPHyGjXW94/edit#heading=h.id227xaj6wxy > > > > User may leave his or her desk when the dialog is poped. That's why the > > timer is > > started only after the dialog is confirmed/canceled. > > > > > > > > > On Fri, May 5, 2017 at 3:22 PM, <mailto:zmin@chromium.org> wrote: > > > > > > > I have tested the dialog on Mac. The dialog itself looks good. But it > > > > seems that > > > > the app modal dialog doesn't block other browser window on Mac. > > > > > > > > I think it's not what I expected. So i remove Mac support for now. > > > > > > > > > > > > On 2017/05/05 00:00:10, sky wrote: > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc > > (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode38 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: bool > > > > > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > How about naming this IsMatchingBrowser and include the > > > > tab_strip_model > > > > > check > > > > > > > here too? > > > > > > Done. > > > > > > Two questions on the implementation: > > > > > > > . Do you really want to incognito windows here? It seems weird to > > > > anchor > > > > to > > > > > an > > > > > > > incognito window? > > > > > > > . Are you sure you don't want to look at the type? Anchoring to > > > > popups > > > > could > > > > > > be > > > > > > > weird. > > > > > > > . Don't you want to check visibility of the window? > > > > > > > > > > > > The purpose the dialog is warning the window closing. So > > > > > > Visibility, yes I'll check the visibility. it seems no harm to > > close > > > > if all > > > > > > windows are invisible. > > > > > > > > > > Be careful there. You should verify you get the right thing if the > > > > window is > > > > > minimized. I would say in that case you should force the window to be > > > > shown > > > > and > > > > > then show the dialog. > > > > > > > > I have tested that, this IsVisible function returns True for a > > minimized > > > > window. > > > > > > > > > > > > > > > Incognito and popups. I agree it's kinda weird. But since they > > will be > > > > closed > > > > > > later as well, I think it make sense to show the warning msg > > before. > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > > app_modal::AppModalDialog( > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > Why are you using app_modal_dialog here? I understand that you > > want > > > > app > > > > > modal, > > > > > > > but you needn't use the AppModal class for that. Using the > > Appmodal > > > > class > > > > > ties > > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > > > this: > > > > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > > It prevent user open other browser window when the dialog is being > > > > displayed. > > > > > > And right now I only found AppModalDialog class can do so with > > > > > > AppModalDialogQueue. User can still use other chrome window when a > > > > normal > > > > > window > > > > > > modal dialog is opened. > > > > > > > > > > > > > > > > Also, user could still interact with non-browser windows in Chrome. > > Are > > > > you > > > > sure > > > > > you want that? > > > > > > > > Yes, I think it's good enough. I don't think it's necessary to block a > > > > non-browser window because user can't use them to browser the internet. > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode100 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > > app_modal::AppModalDialog( > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > Why are you using app_modal_dialog here? I understand that you > > want > > > > app > > > > > modal, > > > > > > > but you needn't use the AppModal class for that. Using the > > Appmodal > > > > class > > > > > ties > > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i want is > > > > this: > > > > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > > It prevent user open other browser window when the dialog is being > > > > displayed. > > > > > > And right now I only found AppModalDialog class can do so with > > > > > > AppModalDialogQueue. User can still use other chrome window when a > > > > normal > > > > > window > > > > > > modal dialog is opened. > > > > > > > > > > > > > > > > Also, what happens if the browser you are anchored to ends up > > closing? > > > > This > > > > > could happen for a number of reasons. > > > > > > > > In general, there is always a default behavior(cancel) when dialog is > > > > closed. > > > > Because the dialog instance is stored in the browser process. So i > > guess > > > > it will > > > > always block all browser windows unless the browser process is > > terminated. > > > > In > > > > which cases, it doesn't matter anyway. > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Chromium-reviews" group. > > > To unsubscribe from this group and stop receiving emails from it, send an > > email > > > to mailto:chromium-reviews+unsubscribe@chromium.org. > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org.
On windows I don't believe we have anything app modal. Why is it ok to ignore app windows and other random dialogs that may be created? -Scott On Fri, May 5, 2017 at 4:40 PM, <zmin@chromium.org> wrote: > Is there any true app-modal dialog in chromium? Because this is the only > dialog > class I found when search AppModal in chromium. > If not, I think it's ok not to block app now. I can use other way to block > app > if necessary. > > On 2017/05/05 22:45:08, sky wrote: > > Thanks! > > So, I think if you want true app-modal you need to use another mechanism. > > The mechanism you are using here is not necessarily app modal. It's only > > modal against browsers. For examples, apps don't hit the code path you > > mentioned. > > > > -Scott > > > > On Fri, May 5, 2017 at 3:42 PM, <mailto:zmin@chromium.org> wrote: > > > > > On 2017/05/05 22:32:20, sky wrote: > > > > Sorry to ask this now, but is there a design doc for this? I'm > wondering > > > > why we are trying to block usage at all instead of presenting the > warning > > > > timer and forcing closing if the timer expires? > > > Yes: > > > https://docs.google.com/document/d/1cfDuV6n7puoWV2cMVI_LXlY8TOh1_ > > > jNulVPHyGjXW94/edit#heading=h.id227xaj6wxy > > > > > > User may leave his or her desk when the dialog is poped. That's why the > > > timer is > > > started only after the dialog is confirmed/canceled. > > > > > > > > > > > > > On Fri, May 5, 2017 at 3:22 PM, <mailto:zmin@chromium.org> wrote: > > > > > > > > > I have tested the dialog on Mac. The dialog itself looks good. But > it > > > > > seems that > > > > > the app modal dialog doesn't block other browser window on Mac. > > > > > > > > > > I think it's not what I expected. So i remove Mac support for now. > > > > > > > > > > > > > > > On 2017/05/05 00:00:10, sky wrote: > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > (right): > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode38 > > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: > bool > > > > > > IsBrowserBelongedToProfile(Browser* browser, Profile* profile) { > > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > > How about naming this IsMatchingBrowser and include the > > > > > tab_strip_model > > > > > > check > > > > > > > > here too? > > > > > > > Done. > > > > > > > Two questions on the implementation: > > > > > > > > . Do you really want to incognito windows here? It seems > weird to > > > > > anchor > > > > > to > > > > > > an > > > > > > > > incognito window? > > > > > > > > . Are you sure you don't want to look at the type? Anchoring > to > > > > > popups > > > > > could > > > > > > > be > > > > > > > > weird. > > > > > > > > . Don't you want to check visibility of the window? > > > > > > > > > > > > > > The purpose the dialog is warning the window closing. So > > > > > > > Visibility, yes I'll check the visibility. it seems no harm to > > > close > > > > > if all > > > > > > > windows are invisible. > > > > > > > > > > > > Be careful there. You should verify you get the right thing if > the > > > > > window is > > > > > > minimized. I would say in that case you should force the window > to be > > > > > shown > > > > > and > > > > > > then show the dialog. > > > > > > > > > > I have tested that, this IsVisible function returns True for a > > > minimized > > > > > window. > > > > > > > > > > > > > > > > > > Incognito and popups. I agree it's kinda weird. But since they > > > will be > > > > > closed > > > > > > > later as well, I think it make sense to show the warning msg > > > before. > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > > chrome/browser/ui/views/profiles/force_signout_dialog. > cc#newcode100 > > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > > > app_modal::AppModalDialog( > > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > > Why are you using app_modal_dialog here? I understand that > you > > > want > > > > > app > > > > > > modal, > > > > > > > > but you needn't use the AppModal class for that. Using the > > > Appmodal > > > > > class > > > > > > ties > > > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i > want is > > > > > this: > > > > > > > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > > > It prevent user open other browser window when the dialog is > being > > > > > displayed. > > > > > > > And right now I only found AppModalDialog class can do so with > > > > > > > AppModalDialogQueue. User can still use other chrome window > when a > > > > > normal > > > > > > window > > > > > > > modal dialog is opened. > > > > > > > > > > > > > > > > > > > Also, user could still interact with non-browser windows in > Chrome. > > > Are > > > > > you > > > > > sure > > > > > > you want that? > > > > > > > > > > Yes, I think it's good enough. I don't think it's necessary to > block a > > > > > non-browser window because user can't use them to browser the > internet. > > > > > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/80001/ > > > > > chrome/browser/ui/views/profiles/force_signout_dialog. > cc#newcode100 > > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:100: : > > > > > > app_modal::AppModalDialog( > > > > > > On 2017/05/04 23:13:52, zmin wrote: > > > > > > > On 2017/05/04 03:45:11, sky wrote: > > > > > > > > Why are you using app_modal_dialog here? I understand that > you > > > want > > > > > app > > > > > > modal, > > > > > > > > but you needn't use the AppModal class for that. Using the > > > Appmodal > > > > > class > > > > > > ties > > > > > > > > you to WebContents, which I'm not sure you want. > > > > > > > > > > > > > > No, I don't want to be tied to WebContents. However, what i > want is > > > > > this: > > > > > > > > > > > > > > > > > > https://cs.chromium.org/chromium/src/chrome/browser/ > > > > > ui/views/frame/browser_view.cc?sq=package:chromium&dr&l=1584 > > > > > > > It prevent user open other browser window when the dialog is > being > > > > > displayed. > > > > > > > And right now I only found AppModalDialog class can do so with > > > > > > > AppModalDialogQueue. User can still use other chrome window > when a > > > > > normal > > > > > > window > > > > > > > modal dialog is opened. > > > > > > > > > > > > > > > > > > > Also, what happens if the browser you are anchored to ends up > > > closing? > > > > > This > > > > > > could happen for a number of reasons. > > > > > > > > > > In general, there is always a default behavior(cancel) when dialog > is > > > > > closed. > > > > > Because the dialog instance is stored in the browser process. So i > > > guess > > > > > it will > > > > > always block all browser windows unless the browser process is > > > terminated. > > > > > In > > > > > which cases, it doesn't matter anyway. > > > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > Groups > > > > "Chromium-reviews" group. > > > > To unsubscribe from this group and stop receiving emails from it, > send an > > > email > > > > to mailto:chromium-reviews+unsubscribe@chromium.org. > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Chromium-reviews" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email > > to mailto:chromium-reviews+unsubscribe@chromium.org. > > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by zmin@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...
On 2017/05/07 22:45:54, sky wrote: > On windows I don't believe we have anything app modal. > > Why is it ok to ignore app windows and other random dialogs that may be > created? It will be awesome if there is a true app modal dialog. However, I don't feel it's necessary to create a one here. Compare to the browser window, the thing user can do with a app window or a random dialog is limited. In the other word, a user have to try very hard to escape the policies and break the force sign in system. Then he/she get a small part of Chrome. That's why I think it's not a critical issue for now so that it won't block the launch of the project. And once the feature is online, it's also more easy for me to find a proper solution here with user feedback.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Fair enough. My concern then is that you are using the existing appmodal code, which is intended for use with a WebContents. That doesn't make sense in the context you are trying to use it. On Mon, May 8, 2017 at 1:25 PM, <zmin@chromium.org> wrote: > On 2017/05/07 22:45:54, sky wrote: > > On windows I don't believe we have anything app modal. > > > > Why is it ok to ignore app windows and other random dialogs that may be > > created? > > It will be awesome if there is a true app modal dialog. However, > I don't feel it's necessary to create a one here. > > Compare to the browser window, the thing user can do with a app window or a > random dialog is limited. > In the other word, a user have to try very hard to escape the policies and > break > the force sign in system. Then he/she get a small > part of Chrome. > > That's why I think it's not a critical issue for now so that it won't > block the > launch of the project. And once the feature is online, it's also > more easy for me to find a proper solution here with user feedback. > > > > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Yes, I agree tie this dialog to a WebContents is a weird logic. However, app_modal dialog is the only dialog I found that will prevent other browser windows being activated. For normal window type modal dialog, user can ignore the dialog by opening a new browser window. I think for now, implement this appmodal dialog means I can reuse the code related to browser window activation. And I think it's only used to find the Browser instance outside the dialog. For long term, I think we might need to either create another app_modal dialog associated with Browser instead of WebContents. Or decouple the WebContent from app_modal dialog and move it to javascript_app_modal_dialog On Mon, May 8, 2017 at 5:48 PM, Scott Violet <sky@chromium.org> wrote: > Fair enough. My concern then is that you are using the existing appmodal > code, which is intended for use with a WebContents. That doesn't make sense > in the context you are trying to use it. > > On Mon, May 8, 2017 at 1:25 PM, <zmin@chromium.org> wrote: > >> On 2017/05/07 22:45:54, sky wrote: >> > On windows I don't believe we have anything app modal. >> > >> > Why is it ok to ignore app windows and other random dialogs that may be >> > created? >> >> It will be awesome if there is a true app modal dialog. However, >> I don't feel it's necessary to create a one here. >> >> Compare to the browser window, the thing user can do with a app window or >> a >> random dialog is limited. >> In the other word, a user have to try very hard to escape the policies >> and break >> the force sign in system. Then he/she get a small >> part of Chrome. >> >> That's why I think it's not a critical issue for now so that it won't >> block the >> launch of the project. And once the feature is online, it's also >> more easy for me to find a proper solution here with user feedback. >> >> >> >> >> >> https://codereview.chromium.org/2862653002/ >> > > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
You are using code that happens to provide functionality close to what you want, even though it was designed for something else and hasn't different constraints. That isn't the right thing for long term maintainability. Your code should *not* be tied to extracting a WebContents from a Browser. -Scott On Mon, May 8, 2017 at 3:37 PM, Owen Min <zmin@google.com> wrote: > Yes, I agree tie this dialog to a WebContents is a weird logic. However, > app_modal dialog is the only dialog I found that will prevent other browser > windows being activated. For normal window type modal dialog, user can > ignore the dialog by opening a new browser window. > > I think for now, implement this appmodal dialog means I can reuse the code > related to browser window activation. And I think it's only used to find > the Browser instance outside the dialog. For long term, I think we might > need to either create another app_modal dialog associated with Browser > instead of WebContents. Or decouple the WebContent from app_modal dialog > and move it to javascript_app_modal_dialog > > On Mon, May 8, 2017 at 5:48 PM, Scott Violet <sky@chromium.org> wrote: > >> Fair enough. My concern then is that you are using the existing appmodal >> code, which is intended for use with a WebContents. That doesn't make sense >> in the context you are trying to use it. >> >> On Mon, May 8, 2017 at 1:25 PM, <zmin@chromium.org> wrote: >> >>> On 2017/05/07 22:45:54, sky wrote: >>> > On windows I don't believe we have anything app modal. >>> > >>> > Why is it ok to ignore app windows and other random dialogs that may be >>> > created? >>> >>> It will be awesome if there is a true app modal dialog. However, >>> I don't feel it's necessary to create a one here. >>> >>> Compare to the browser window, the thing user can do with a app window >>> or a >>> random dialog is limited. >>> In the other word, a user have to try very hard to escape the policies >>> and break >>> the force sign in system. Then he/she get a small >>> part of Chrome. >>> >>> That's why I think it's not a critical issue for now so that it won't >>> block the >>> launch of the project. And once the feature is online, it's also >>> more easy for me to find a proper solution here with user feedback. >>> >>> >>> >>> >>> >>> https://codereview.chromium.org/2862653002/ >>> >> >> > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was checked by zmin@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...
On 2017/05/08 22:54:52, sky wrote: > You are using code that happens to provide functionality close to what you > want, even though it was designed for something else and hasn't different > constraints. That isn't the right thing for long term maintainability. Your > code should *not* be tied to extracting a WebContents from a Browser. I have refactor the code, the dialog is no longer inherit from app_modal::AppModalDialog and it's no longer associated with WebContents instance.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
sky@chromium.org changed reviewers: + avi@chromium.org
+avi for app_modal below. zmin: don't go back to app_modal until you here from Avi. I don't want you to waste more cycles. Sorry again. https://codereview.chromium.org/2862653002/diff/160001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/160001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1585: if ((!queue->active_dialog() || !queue->active_dialog()->native_dialog() || Ugh! Sorry, I think I sent you down the wrong path. I think you should go back to using app_modal, but make it so that app_modal does not need a WebContents. I'm adding avi as he is an owner of app_modal to make sure he doesn't see any problems with that approach.
On 2017/05/10 15:43:26, sky wrote: > +avi for app_modal below. > zmin: don't go back to app_modal until you here from Avi. I don't want you to > waste more cycles. Sorry again. > > https://codereview.chromium.org/2862653002/diff/160001/chrome/browser/ui/view... > File chrome/browser/ui/views/frame/browser_view.cc (right): > > https://codereview.chromium.org/2862653002/diff/160001/chrome/browser/ui/view... > chrome/browser/ui/views/frame/browser_view.cc:1585: if ((!queue->active_dialog() > || !queue->active_dialog()->native_dialog() || > Ugh! Sorry, I think I sent you down the wrong path. I think you should go back > to using app_modal, but make it so that app_modal does not need a WebContents. > I'm adding avi as he is an owner of app_modal to make sure he doesn't see any > problems with that approach. I have thought about decouple the WebContents from AppModalDialog. As from the naming perspective, an app modal dialog doesn't sound very related to a web page. I didn't choose to do so because: 1) It seems not very trivial refactor. And it will affect all platforms not just desktop. And I can't find any test to bless the refactor. 2) After removing WebContents, the naming could still confuse people as it's not a true app modal dialog. It's ok for me right now as we discussed above. However, it might not be true for the next person. I'd like to hear avi's opinion on this. I'll wait for his post.
The notion of extending app_modal and using app-modal dialogs does not sit well with me at all. - app_modal:: was built to be used for JavaScript dialogs and was designed to be based around WebContents; you're proposing changing that. - app_modal:: has no maintainers. I'm an OWNER but I'm *actively working on killing it*. I have removed a good amount of its use via auto-dismissing dialogs, I hope to eliminate its use by beforeunload dialogs and by extension code. - It has zero real tests and is broken and has been broken on Linux for a very very long time (see bugs 709679 and 709685). Again, zero maintainers. Please don't add more use of it. Please.
The CQ bit was checked by zmin@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...
Patchset #7 (id:180001) has been deleted
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by zmin@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_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #7 (id:200001) has been deleted
The CQ bit was checked by zmin@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: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
Ok, thanks Avi. I'll remove you as a reviewer as this won't use app_modal.
Description was changed from ========== If force-sign-in policy is enabled, popup warning dialog before window closing if auth token become invalid. Screenshots: https://goo.gl/photos/3KiQsSAPTse5brR89 https://goo.gl/photos/1jdyC86dSSyZVdi8A BUG=642059 ========== to ========== If force-sign-in policy is enabled, popup warning dialog before window closing if auth token become invalid. Screenshots: https://goo.gl/photos/3KiQsSAPTse5brR89 https://goo.gl/photos/1jdyC86dSSyZVdi8A BUG=642059 ==========
sky@chromium.org changed reviewers: - avi@chromium.org
https://codereview.chromium.org/2862653002/diff/220001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/220001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1587: if ((!queue->active_dialog() || !queue->active_dialog()->native_dialog() || Continually adding dependencies from BrowserView onto things that want to be app modal like doesn't scale. So, please introduce a pure virtual class that BrowserView talks to that has an implementation wrapping app_modal, and another wrapping your class. This way BrowserView won't depend directly on app_modal or ForceSignoutDialog. Additionally it's easy to plug in any new app_modal like functionality without changing BrowserView.
The CQ bit was checked by zmin@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...
On 2017/05/12 13:15:16, sky wrote: > https://codereview.chromium.org/2862653002/diff/220001/chrome/browser/ui/view... > File chrome/browser/ui/views/frame/browser_view.cc (right): > > https://codereview.chromium.org/2862653002/diff/220001/chrome/browser/ui/view... > chrome/browser/ui/views/frame/browser_view.cc:1587: if ((!queue->active_dialog() > || !queue->active_dialog()->native_dialog() || > Continually adding dependencies from BrowserView onto things that want to be app > modal like doesn't scale. So, please introduce a pure virtual class that > BrowserView talks to that has an implementation wrapping app_modal, and another > wrapping your class. This way BrowserView won't depend directly on app_modal or > ForceSignoutDialog. Additionally it's easy to plug in any new app_modal like > functionality without changing BrowserView. I created a virtual class for my dialog and a list of virtual class for the situations there're multiple dialogs at same time. BrowserView only needs to talk with the list. I didn't wrap app_modal dialog because it's already present as singleton list of dialogs. I don't want to put a list into another as it increases complexity of code. Also, by doing this, Chrome's own browser dialogs can always be activated before JS dialogs.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #8 (id:240001) has been deleted
The CQ bit was checked by zmin@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: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.cc:30: if (it != dialogs_.end()) { no {} https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.h (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:37: void AddDialog(BrowserModalDialog* dialog); newline between 37/38. Also, document ownership. https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:47: BrowserModalDialogList(); style guide says constructor/destructor before other functions (including statics). https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog_unittest.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog_unittest.cc:8: #include "chrome/browser/ui/views/browser_modal_dialog.h" this should be your first include, then newline, then <memory> (see style guide). https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1586: !BrowserModalDialogList::GetInstance()->IsShowing()) { This has BrowserView needing to know about both types. As I requested earlier, "So, please introduce a pure virtual class that BrowserView talks to that has an implementation wrapping app_modal, and another wrapping your class." This way BrowserView *only* talks to BrowserModalDialog. Not BrowserModalDialog *and* app_modal.
The CQ bit was checked by zmin@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/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.cc:30: if (it != dialogs_.end()) { On 2017/05/16 12:40:32, sky wrote: > no {} Done. https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.h (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:37: void AddDialog(BrowserModalDialog* dialog); On 2017/05/16 12:40:32, sky wrote: > newline between 37/38. Also, document ownership. Done. https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:47: BrowserModalDialogList(); On 2017/05/16 12:40:32, sky wrote: > style guide says constructor/destructor before other functions (including > statics). Done. https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog_unittest.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog_unittest.cc:8: #include "chrome/browser/ui/views/browser_modal_dialog.h" On 2017/05/16 12:40:33, sky wrote: > this should be your first include, then newline, then <memory> (see style > guide). Done. https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/260001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1586: !BrowserModalDialogList::GetInstance()->IsShowing()) { On 2017/05/16 12:40:33, sky wrote: > This has BrowserView needing to know about both types. As I requested earlier, > "So, please introduce a pure virtual class that BrowserView talks to that has an > implementation wrapping app_modal, and another wrapping your class." This way > BrowserView *only* talks to BrowserModalDialog. Not BrowserModalDialog *and* > app_modal. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
https://codereview.chromium.org/2862653002/diff/280001/chrome/app/google_chro... File chrome/app/google_chrome_strings.grd (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/app/google_chro... chrome/app/google_chrome_strings.grd:766: Close all Google Chrome windows and sign in now Are you sure you need 'Google' here? We don't always use 'Google' in these strings. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/app_modal_dialog_queue_wrapper.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.cc:24: #if defined(USE_AURA) && defined(OS_CHROMEOS) Please add description as to why the two are different. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:12: class AppModalDialogQueueWrapper : public BrowserModalDialog { Description. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:17: void ActivateModalDialog(Browser* browser) override; Document where overrides come from. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:19: }; DISALLOW.. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:21: // A browser modal dialog that will prevent the browser windows that does not How about: 'BrowserModalDialog prevents all browser windows from being active.' https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:29: explicit BrowserModalDialog(bool with_list); Doing processing like you have here in the constructor of a pure virtual class is error prone (you're making it all too easy to attempt to use pure virtual functions before the subclass is created). Have the callers explicitly do Add. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:34: virtual void ActivateModalDialog(Browser* other_browser) = 0; Document what browser is. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:40: // The list of BrowserModalDialog. BrowserModalDialog -> BrowserModalDialogs https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:43: BrowserModalDialogList(); Can the constructor/destructor be private as GetInstance() should be used? https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:53: // Activate the oldest BrowserModalDialog and return true. Return false if return -> returns https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:55: void ActivateModalDialog(Browser* browser); Document what browser is. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:57: // Return true if there is any BrowserModalDialog is visible. Returns true if any BrowserModalDialogs are visible. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog_unittest.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog_unittest.cc:29: }; private: DISALLOW. optional: Although that said this class isn't really saving you much, I would be inclined to move the getter to each test and don't subclass. But it's up to you. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1579: if (!BrowserModalDialogList::GetInstance()->IsShowing()) { no {} https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:27: const base::Closure& signout_timer); signout_closure? Also, document what 'browser' and signout_timer is. I would expect the closure to always be run, and with a status code indicating what happened. Otherwise it's super confusing to know what it's for. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:30: // Show the warning dialog on the browser window that is belonged to the How about: Shows a warning dialog for |profile|. If there are no Browser windows associated with |profile| this signs out the profile immediately, otherwise the user clicks accept on the dialog. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:41: int buttons; buttons_ (and document what it is). https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:42: }; DISALLOW... https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_view.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_view.h:18: class ForceSignoutDialogView : public views::DialogDelegateView { Why do you need both ForceSignoutDialog and ForceSignoutDialogView? Did you consider making this class directly implement BrowserModalDialog? I think that would simplify things.
The CQ bit was checked by zmin@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/2862653002/diff/280001/chrome/app/google_chro... File chrome/app/google_chrome_strings.grd (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/app/google_chro... chrome/app/google_chrome_strings.grd:766: Close all Google Chrome windows and sign in now On 2017/05/17 18:03:17, sky wrote: > Are you sure you need 'Google' here? We don't always use 'Google' in these > strings. There is a same string in chromium_string.grd that use Chromium instead of Google Chrome. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/app_modal_dialog_queue_wrapper.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.cc:24: #if defined(USE_AURA) && defined(OS_CHROMEOS) On 2017/05/17 18:03:17, sky wrote: > Please add description as to why the two are different. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:12: class AppModalDialogQueueWrapper : public BrowserModalDialog { On 2017/05/17 18:03:17, sky wrote: > Description. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:17: void ActivateModalDialog(Browser* browser) override; On 2017/05/17 18:03:17, sky wrote: > Document where overrides come from. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/app_modal_dialog_queue_wrapper.h:19: }; On 2017/05/17 18:03:17, sky wrote: > DISALLOW.. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:21: // A browser modal dialog that will prevent the browser windows that does not On 2017/05/17 18:03:18, sky wrote: > How about: 'BrowserModalDialog prevents all browser windows from being active.' Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:29: explicit BrowserModalDialog(bool with_list); On 2017/05/17 18:03:18, sky wrote: > Doing processing like you have here in the constructor of a pure virtual class > is error prone (you're making it all too easy to attempt to use pure virtual > functions before the subclass is created). Have the callers explicitly do Add. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:34: virtual void ActivateModalDialog(Browser* other_browser) = 0; On 2017/05/17 18:03:17, sky wrote: > Document what browser is. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:40: // The list of BrowserModalDialog. On 2017/05/17 18:03:18, sky wrote: > BrowserModalDialog -> BrowserModalDialogs Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:43: BrowserModalDialogList(); On 2017/05/17 18:03:17, sky wrote: > Can the constructor/destructor be private as GetInstance() should be used? Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:53: // Activate the oldest BrowserModalDialog and return true. Return false if On 2017/05/17 18:03:18, sky wrote: > return -> returns Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:55: void ActivateModalDialog(Browser* browser); On 2017/05/17 18:03:18, sky wrote: > Document what browser is. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog.h:57: // Return true if there is any BrowserModalDialog is visible. On 2017/05/17 18:03:17, sky wrote: > Returns true if any BrowserModalDialogs are visible. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/browser_modal_dialog_unittest.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/browser_modal_dialog_unittest.cc:29: }; On 2017/05/17 18:03:18, sky wrote: > private: DISALLOW. > optional: Although that said this class isn't really saving you much, I would be > inclined to move the getter to each test and don't subclass. But it's up to you. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/frame/browser_view.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/frame/browser_view.cc:1579: if (!BrowserModalDialogList::GetInstance()->IsShowing()) { On 2017/05/17 18:03:18, sky wrote: > no {} Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:27: const base::Closure& signout_timer); On 2017/05/17 18:03:18, sky wrote: > signout_closure? Also, document what 'browser' and signout_timer is. > I would expect the closure to always be run, and with a status code indicating > what happened. Otherwise it's super confusing to know what it's for. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:30: // Show the warning dialog on the browser window that is belonged to the On 2017/05/17 18:03:18, sky wrote: > How about: > > Shows a warning dialog for |profile|. If there are no Browser windows associated > with |profile| this signs out the profile immediately, otherwise the user clicks > accept on the dialog. Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:41: int buttons; On 2017/05/17 18:03:18, sky wrote: > buttons_ (and document what it is). Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:42: }; On 2017/05/17 18:03:18, sky wrote: > DISALLOW... Done. https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_view.h (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_view.h:18: class ForceSignoutDialogView : public views::DialogDelegateView { On 2017/05/17 18:03:18, sky wrote: > Why do you need both ForceSignoutDialog and ForceSignoutDialogView? Did you > consider making this class directly implement BrowserModalDialog? I think that > would simplify things. I created two classes at the beginning to avoid one giant class. However, these two classes are couple with each other deeply and it does make some unnecessary complexity. So I'll merge them.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2862653002/diff/280001/chrome/app/google_chro... File chrome/app/google_chrome_strings.grd (right): https://codereview.chromium.org/2862653002/diff/280001/chrome/app/google_chro... chrome/app/google_chrome_strings.grd:766: Close all Google Chrome windows and sign in now On 2017/05/18 03:31:17, zmin wrote: > On 2017/05/17 18:03:17, sky wrote: > > Are you sure you need 'Google' here? We don't always use 'Google' in these > > strings. > > There is a same string in chromium_string.grd that use Chromium instead of > Google Chrome. Not sure if was being clear. I'm suggesting you say 'Close all Chrome windows and sign in now.' But I'm not sure that is right, so leave what you have. https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:83: } It's possible to get here without accept/cancel being called. That happens if the browser closes while the dialog is up, which triggers destroying the dialog. https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:118: if (browser_ == browser) You shouldn't need this. The dialog is parented to and owned by the browser. So, if the browser is destroyed the dialog will be destroyed as well. This begs the question as to what you want to have happen in such a scenario? It would be good to add test coverage of this scenario. https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:30: using SignoutCallback = base::Callback<void(bool)>; Use OnceCallback. https://codereview.chromium.org/2862653002/diff/300001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:37: bool delay_allowed); I was confused by the name delay_allowed. How about can_postpone, or can_delay_signout?
Patchset #11 (id:320001) has been deleted
The CQ bit was checked by zmin@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...
Patchset #11 (id:340001) has been deleted
Hi Scott, I have chatted with the UX. And based on our discussion, here is the new dialog. This is a normal window modal dialog attached to one of profile's browser window. Browser window will be activated when dialog is displayed in case it's minimized. Browser window closing countdown will start when the dialog is being displayed. The dialog will also display how much time left before closing. Owen
The CQ bit was checked by zmin@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/2862653002/diff/360001/chrome/app/generated_r... File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/app/generated_r... chrome/app/generated_resources.grd:8108: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_CONFIRM" desc="Text of the button to confirm close all browser windows"> This description doesn't match the actual text. https://codereview.chromium.org/2862653002/diff/360001/chrome/app/generated_r... chrome/app/generated_resources.grd:8115: All browser windows will be closed automatically soon without sign in. All browser windows will soon be closed... https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: const int kRefreshTitleTimer = 1; // Refresh title of the dialog every second. constexpr on both of these. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:40: 60; // If browser windows are going to be closed soon, close browser window Move comment above constant so you don't get weird wrapping. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: views::GridLayout* dialog_layout = new views::GridLayout(this); Why do you need two GridLayouts? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return close_timer_->desired_run_time() - base::TimeTicks::Now(); To avoid possible weird bugs I recommend making this negative. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class ForceSignoutDialog : public views::DialogDelegateView { WDYT of naming this ReauthenticateDialog? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:30: // Show the dialog for |browser|, call signout_callback after the dialog is there is no signout_callback. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:32: ForceSignoutDialog(Browser* browser, Does this function need to be public? Don't you want to force usage of Show? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* close_timer); Document ownership. Also, why does the caller need to supply a timer? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:41: // |delay_allow| is true. Call |signout_callback| with false if user cancel There is no delay_allow or signout_callback. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:43: static ForceSignoutDialog* ShowDialog(Profile* profile, Document who owns the return value. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:60: base::TimeDelta GetCountDownRemainTime() const; remaining? optional: rename this GetTimeRemaining(). https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:65: base::RepeatingTimer refresh_timer_; It's not obvious why you have two timers and is worth a comment. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:12: #include "chrome/browser/ui/views/profiles/force_signout_dialog.h" This should be your first include, then newline, then rest. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:18: void FakeFunction() {} use base::DoNothing() (in bind_helpers).
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by zmin@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/2862653002/diff/360001/chrome/app/generated_r... File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/app/generated_r... chrome/app/generated_resources.grd:8108: <message name="IDS_ENTERPRISE_FORCE_SIGNOUT_CLOSE_CONFIRM" desc="Text of the button to confirm close all browser windows"> On 2017/06/05 23:43:18, sky wrote: > This description doesn't match the actual text. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/app/generated_r... chrome/app/generated_resources.grd:8115: All browser windows will be closed automatically soon without sign in. On 2017/06/05 23:43:18, sky wrote: > All browser windows will soon be closed... Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:38: const int kRefreshTitleTimer = 1; // Refresh title of the dialog every second. On 2017/06/05 23:43:18, sky wrote: > constexpr on both of these. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:40: 60; // If browser windows are going to be closed soon, close browser window On 2017/06/05 23:43:18, sky wrote: > Move comment above constant so you don't get weird wrapping. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: views::GridLayout* dialog_layout = new views::GridLayout(this); On 2017/06/05 23:43:18, sky wrote: > Why do you need two GridLayouts? dialog_layout is the global layout for the whole dialog. The additional layout(prompt_layout) is for the sub-view that contains the prompt_label view. The sub-view has different background color, padding and border. I just removed the sub-view with its layout and append the label to the dialog layout directly. Is multiple levels of layout bad for the performance? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return close_timer_->desired_run_time() - base::TimeTicks::Now(); On 2017/06/05 23:43:18, sky wrote: > To avoid possible weird bugs I recommend making this negative. Why negative result will avoid weird bug, is it because the overflow when desired_run_time is less than current time? How about I just make sure it always return non-negative number? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class ForceSignoutDialog : public views::DialogDelegateView { On 2017/06/05 23:43:18, sky wrote: > WDYT of naming this ReauthenticateDialog? There're lots of different situations requires reauth, how about ForceReauthenticateDialog https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:30: // Show the dialog for |browser|, call signout_callback after the dialog is On 2017/06/05 23:43:19, sky wrote: > there is no signout_callback. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:32: ForceSignoutDialog(Browser* browser, On 2017/06/05 23:43:18, sky wrote: > Does this function need to be public? Don't you want to force usage of Show? Move it to private https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* close_timer); On 2017/06/05 23:43:18, sky wrote: > Document ownership. Also, why does the caller need to supply a timer? The |close_timer| is used to track the remaining time mainly. It will also be used to 1) Stop the timer if there is no opened browser window as we can sign out user without delay. 2) Close the dialog if the timer is stopped https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:41: // |delay_allow| is true. Call |signout_callback| with false if user cancel On 2017/06/05 23:43:18, sky wrote: > There is no delay_allow or signout_callback. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:43: static ForceSignoutDialog* ShowDialog(Profile* profile, On 2017/06/05 23:43:19, sky wrote: > Document who owns the return value. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:60: base::TimeDelta GetCountDownRemainTime() const; On 2017/06/05 23:43:18, sky wrote: > remaining? > optional: rename this GetTimeRemaining(). Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:65: base::RepeatingTimer refresh_timer_; On 2017/06/05 23:43:18, sky wrote: > It's not obvious why you have two timers and is worth a comment. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:12: #include "chrome/browser/ui/views/profiles/force_signout_dialog.h" On 2017/06/05 23:43:19, sky wrote: > This should be your first include, then newline, then rest. Done. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog_browsertest.cc:18: void FakeFunction() {} On 2017/06/05 23:43:19, sky wrote: > use base::DoNothing() (in bind_helpers). Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: views::GridLayout* dialog_layout = new views::GridLayout(this); On 2017/06/06 21:00:43, zmin wrote: > On 2017/06/05 23:43:18, sky wrote: > > Why do you need two GridLayouts? > > dialog_layout is the global layout for the whole dialog. > > The additional layout(prompt_layout) is for the sub-view that contains the > prompt_label view. The sub-view has different background color, padding and > border. > > I just removed the sub-view with its layout and append the label to the dialog > layout directly. > > Is multiple levels of layout bad for the performance? No, I just wanted to understand why it was necessary. Often times it isn't. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return close_timer_->desired_run_time() - base::TimeTicks::Now(); On 2017/06/06 21:00:43, zmin wrote: > On 2017/06/05 23:43:18, sky wrote: > > To avoid possible weird bugs I recommend making this negative. > > Why negative result will avoid weird bug, is it because the overflow when > desired_run_time is less than current time? > > How about I just make sure it always return non-negative number? Sorry, my comment was really bad here. I meant it seems less error prone to ensure this doesn't go negative. But I think TimeDelta hides that, so ignore this comment. Sorry. https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class ForceSignoutDialog : public views::DialogDelegateView { On 2017/06/06 21:00:44, zmin wrote: > On 2017/06/05 23:43:18, sky wrote: > > WDYT of naming this ReauthenticateDialog? > > There're lots of different situations requires reauth, how about > ForceReauthenticateDialog ForcedReauthenticationDialog? https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* close_timer); On 2017/06/06 21:00:43, zmin wrote: > On 2017/06/05 23:43:18, sky wrote: > > Document ownership. Also, why does the caller need to supply a timer? > > The |close_timer| is used to track the remaining time mainly. > It will also be used to > 1) Stop the timer if there is no opened browser window as we can sign out user > without delay. > 2) Close the dialog if the timer is stopped I get that you want a close_timer, but why does it need to be passed in? Can't the dialog own and creates it's own timer?
On 2017/06/06 23:10:39, sky wrote: > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: views::GridLayout* > dialog_layout = new views::GridLayout(this); > On 2017/06/06 21:00:43, zmin wrote: > > On 2017/06/05 23:43:18, sky wrote: > > > Why do you need two GridLayouts? > > > > dialog_layout is the global layout for the whole dialog. > > > > The additional layout(prompt_layout) is for the sub-view that contains the > > prompt_label view. The sub-view has different background color, padding and > > border. > > > > I just removed the sub-view with its layout and append the label to the dialog > > layout directly. > > > > Is multiple levels of layout bad for the performance? > > No, I just wanted to understand why it was necessary. Often times it isn't. > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return > close_timer_->desired_run_time() - base::TimeTicks::Now(); > On 2017/06/06 21:00:43, zmin wrote: > > On 2017/06/05 23:43:18, sky wrote: > > > To avoid possible weird bugs I recommend making this negative. > > > > Why negative result will avoid weird bug, is it because the overflow when > > desired_run_time is less than current time? > > > > How about I just make sure it always return non-negative number? > > Sorry, my comment was really bad here. I meant it seems less error prone to > ensure this doesn't go negative. But I think TimeDelta hides that, so ignore > this comment. Sorry. > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > ForceSignoutDialog : public views::DialogDelegateView { > On 2017/06/06 21:00:44, zmin wrote: > > On 2017/06/05 23:43:18, sky wrote: > > > WDYT of naming this ReauthenticateDialog? > > > > There're lots of different situations requires reauth, how about > > ForceReauthenticateDialog > > ForcedReauthenticationDialog? Sure, I can do that. > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* > close_timer); > On 2017/06/06 21:00:43, zmin wrote: > > On 2017/06/05 23:43:18, sky wrote: > > > Document ownership. Also, why does the caller need to supply a timer? > > > > The |close_timer| is used to track the remaining time mainly. > > It will also be used to > > 1) Stop the timer if there is no opened browser window as we can sign out user > > without delay. > > 2) Close the dialog if the timer is stopped > > I get that you want a close_timer, but why does it need to be passed in? Can't > the dialog own and creates it's own timer? close_timer(5 minutes countdown) will continue after user close the dialog. So at least dialog can't own the timer.
The CQ bit was checked by zmin@chromium.org to run a CQ dry run
On 2017/06/07 00:00:38, zmin wrote: > On 2017/06/06 23:10:39, sky wrote: > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: > views::GridLayout* > > dialog_layout = new views::GridLayout(this); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > Why do you need two GridLayouts? > > > > > > dialog_layout is the global layout for the whole dialog. > > > > > > The additional layout(prompt_layout) is for the sub-view that contains the > > > prompt_label view. The sub-view has different background color, padding and > > > border. > > > > > > I just removed the sub-view with its layout and append the label to the > dialog > > > layout directly. > > > > > > Is multiple levels of layout bad for the performance? > > > > No, I just wanted to understand why it was necessary. Often times it isn't. > > > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return > > close_timer_->desired_run_time() - base::TimeTicks::Now(); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > To avoid possible weird bugs I recommend making this negative. > > > > > > Why negative result will avoid weird bug, is it because the overflow when > > > desired_run_time is less than current time? > > > > > > How about I just make sure it always return non-negative number? > > > > Sorry, my comment was really bad here. I meant it seems less error prone to > > ensure this doesn't go negative. But I think TimeDelta hides that, so ignore > > this comment. Sorry. > > > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): > > > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > > ForceSignoutDialog : public views::DialogDelegateView { > > On 2017/06/06 21:00:44, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > WDYT of naming this ReauthenticateDialog? > > > > > > There're lots of different situations requires reauth, how about > > > ForceReauthenticateDialog > > > > ForcedReauthenticationDialog? > Sure, I can do that. Done. > > > > https://codereview.chromium.org/2862653002/diff/360001/chrome/browser/ui/view... > > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* > > close_timer); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > Document ownership. Also, why does the caller need to supply a timer? > > > > > > The |close_timer| is used to track the remaining time mainly. > > > It will also be used to > > > 1) Stop the timer if there is no opened browser window as we can sign out > user > > > without delay. > > > 2) Close the dialog if the timer is stopped > > > > I get that you want a close_timer, but why does it need to be passed in? Can't > > the dialog own and creates it's own timer? > > close_timer(5 minutes countdown) will continue after user close the dialog. > So at least dialog can't own the timer.
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On Tue, Jun 6, 2017 at 5:00 PM, <zmin@chromium.org> wrote: > On 2017/06/06 23:10:39, sky wrote: > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode198 > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: > views::GridLayout* > > dialog_layout = new views::GridLayout(this); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > Why do you need two GridLayouts? > > > > > > dialog_layout is the global layout for the whole dialog. > > > > > > The additional layout(prompt_layout) is for the sub-view that contains > the > > > prompt_label view. The sub-view has different background color, > padding and > > > border. > > > > > > I just removed the sub-view with its layout and append the label to the > dialog > > > layout directly. > > > > > > Is multiple levels of layout bad for the performance? > > > > No, I just wanted to understand why it was necessary. Often times it > isn't. > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode244 > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return > > close_timer_->desired_run_time() - base::TimeTicks::Now(); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > To avoid possible weird bugs I recommend making this negative. > > > > > > Why negative result will avoid weird bug, is it because the overflow > when > > > desired_run_time is less than current time? > > > > > > How about I just make sure it always return non-negative number? > > > > Sorry, my comment was really bad here. I meant it seems less error prone > to > > ensure this doesn't go negative. But I think TimeDelta hides that, so > ignore > > this comment. Sorry. > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.h > > File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode28 > > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > > ForceSignoutDialog : public views::DialogDelegateView { > > On 2017/06/06 21:00:44, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > WDYT of naming this ReauthenticateDialog? > > > > > > There're lots of different situations requires reauth, how about > > > ForceReauthenticateDialog > > > > ForcedReauthenticationDialog? > Sure, I can do that. > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode34 > > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* > > close_timer); > > On 2017/06/06 21:00:43, zmin wrote: > > > On 2017/06/05 23:43:18, sky wrote: > > > > Document ownership. Also, why does the caller need to supply a timer? > > > > > > The |close_timer| is used to track the remaining time mainly. > > > It will also be used to > > > 1) Stop the timer if there is no opened browser window as we can sign > out > user > > > without delay. > > > 2) Close the dialog if the timer is stopped > > > > I get that you want a close_timer, but why does it need to be passed in? > Can't > > the dialog own and creates it's own timer? > > close_timer(5 minutes countdown) will continue after user close the > dialog. > So at least dialog can't own the timer. > Why does that mean the dialog needs to share the same timer? If the caller needs to maintain a timer, can't it do that? -Scott > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by zmin@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...
On 2017/06/07 16:51:57, sky wrote: > On Tue, Jun 6, 2017 at 5:00 PM, <mailto:zmin@chromium.org> wrote: > > > On 2017/06/06 23:10:39, sky wrote: > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode198 > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: > > views::GridLayout* > > > dialog_layout = new views::GridLayout(this); > > > On 2017/06/06 21:00:43, zmin wrote: > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > Why do you need two GridLayouts? > > > > > > > > dialog_layout is the global layout for the whole dialog. > > > > > > > > The additional layout(prompt_layout) is for the sub-view that contains > > the > > > > prompt_label view. The sub-view has different background color, > > padding and > > > > border. > > > > > > > > I just removed the sub-view with its layout and append the label to the > > dialog > > > > layout directly. > > > > > > > > Is multiple levels of layout bad for the performance? > > > > > > No, I just wanted to understand why it was necessary. Often times it > > isn't. > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode244 > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return > > > close_timer_->desired_run_time() - base::TimeTicks::Now(); > > > On 2017/06/06 21:00:43, zmin wrote: > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > To avoid possible weird bugs I recommend making this negative. > > > > > > > > Why negative result will avoid weird bug, is it because the overflow > > when > > > > desired_run_time is less than current time? > > > > > > > > How about I just make sure it always return non-negative number? > > > > > > Sorry, my comment was really bad here. I meant it seems less error prone > > to > > > ensure this doesn't go negative. But I think TimeDelta hides that, so > > ignore > > > this comment. Sorry. > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.h > > > File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode28 > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > > > ForceSignoutDialog : public views::DialogDelegateView { > > > On 2017/06/06 21:00:44, zmin wrote: > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > WDYT of naming this ReauthenticateDialog? > > > > > > > > There're lots of different situations requires reauth, how about > > > > ForceReauthenticateDialog > > > > > > ForcedReauthenticationDialog? > > Sure, I can do that. > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode34 > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* > > > close_timer); > > > On 2017/06/06 21:00:43, zmin wrote: > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > Document ownership. Also, why does the caller need to supply a timer? > > > > > > > > The |close_timer| is used to track the remaining time mainly. > > > > It will also be used to > > > > 1) Stop the timer if there is no opened browser window as we can sign > > out > > user > > > > without delay. > > > > 2) Close the dialog if the timer is stopped > > > > > > I get that you want a close_timer, but why does it need to be passed in? > > Can't > > > the dialog own and creates it's own timer? > > > > close_timer(5 minutes countdown) will continue after user close the > > dialog. > > So at least dialog can't own the timer. > > > > Why does that mean the dialog needs to share the same timer? If the caller > needs to maintain a timer, can't it do that? > > -Scott I share the timer so that the dialog and caller will share the exactly same timestamp. If this is no necessary, I think the dialog shouldn't care about the timer at all. The caller will tell the dialog the duration of countdown. Dialog use this duration to display the time remaining and dismiss itself after that. > > > > > > > https://codereview.chromium.org/2862653002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org.
On 2017/06/07 19:17:18, zmin wrote: > On 2017/06/07 16:51:57, sky wrote: > > On Tue, Jun 6, 2017 at 5:00 PM, <mailto:zmin@chromium.org> wrote: > > > > > On 2017/06/06 23:10:39, sky wrote: > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc (right): > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode198 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: > > > views::GridLayout* > > > > dialog_layout = new views::GridLayout(this); > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > Why do you need two GridLayouts? > > > > > > > > > > dialog_layout is the global layout for the whole dialog. > > > > > > > > > > The additional layout(prompt_layout) is for the sub-view that contains > > > the > > > > > prompt_label view. The sub-view has different background color, > > > padding and > > > > > border. > > > > > > > > > > I just removed the sub-view with its layout and append the label to the > > > dialog > > > > > layout directly. > > > > > > > > > > Is multiple levels of layout bad for the performance? > > > > > > > > No, I just wanted to understand why it was necessary. Often times it > > > isn't. > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode244 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: return > > > > close_timer_->desired_run_time() - base::TimeTicks::Now(); > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > To avoid possible weird bugs I recommend making this negative. > > > > > > > > > > Why negative result will avoid weird bug, is it because the overflow > > > when > > > > > desired_run_time is less than current time? > > > > > > > > > > How about I just make sure it always return non-negative number? > > > > > > > > Sorry, my comment was really bad here. I meant it seems less error prone > > > to > > > > ensure this doesn't go negative. But I think TimeDelta hides that, so > > > ignore > > > > this comment. Sorry. > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.h > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.h (right): > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode28 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > > > > ForceSignoutDialog : public views::DialogDelegateView { > > > > On 2017/06/06 21:00:44, zmin wrote: > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > WDYT of naming this ReauthenticateDialog? > > > > > > > > > > There're lots of different situations requires reauth, how about > > > > > ForceReauthenticateDialog > > > > > > > > ForcedReauthenticationDialog? > > > Sure, I can do that. > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode34 > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: base::Timer* > > > > close_timer); > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > Document ownership. Also, why does the caller need to supply a timer? > > > > > > > > > > The |close_timer| is used to track the remaining time mainly. > > > > > It will also be used to > > > > > 1) Stop the timer if there is no opened browser window as we can sign > > > out > > > user > > > > > without delay. > > > > > 2) Close the dialog if the timer is stopped > > > > > > > > I get that you want a close_timer, but why does it need to be passed in? > > > Can't > > > > the dialog own and creates it's own timer? > > > > > > close_timer(5 minutes countdown) will continue after user close the > > > dialog. > > > So at least dialog can't own the timer. > > > > > > > Why does that mean the dialog needs to share the same timer? If the caller > > needs to maintain a timer, can't it do that? > > > > -Scott > > I share the timer so that the dialog and caller will share the exactly same > timestamp. > > If this is no necessary, I think the dialog shouldn't care about the timer at > all. > The caller will tell the dialog the duration of countdown. > Dialog use this duration to display the time remaining and dismiss itself after > that. The duration will be controlled by caller for different situation. For example, if Chrome was just launched a second ago, there is no need to give full five minutes countdown. I have chatted this with the UX. > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Chromium-reviews" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email > > to mailto:chromium-reviews+unsubscribe@chromium.org.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Can the consumer supply the duration to the dialog? On Wed, Jun 7, 2017 at 12:22 PM, <zmin@chromium.org> wrote: > On 2017/06/07 19:17:18, zmin wrote: > > On 2017/06/07 16:51:57, sky wrote: > > > On Tue, Jun 6, 2017 at 5:00 PM, <mailto:zmin@chromium.org> wrote: > > > > > > > On 2017/06/06 23:10:39, sky wrote: > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc > > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.cc > (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode198 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:198: > > > > views::GridLayout* > > > > > dialog_layout = new views::GridLayout(this); > > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > > Why do you need two GridLayouts? > > > > > > > > > > > > dialog_layout is the global layout for the whole dialog. > > > > > > > > > > > > The additional layout(prompt_layout) is for the sub-view that > contains > > > > the > > > > > > prompt_label view. The sub-view has different background color, > > > > padding and > > > > > > border. > > > > > > > > > > > > I just removed the sub-view with its layout and append the label > to > the > > > > dialog > > > > > > layout directly. > > > > > > > > > > > > Is multiple levels of layout bad for the performance? > > > > > > > > > > No, I just wanted to understand why it was necessary. Often times > it > > > > isn't. > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc#newcode244 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.cc:244: > return > > > > > close_timer_->desired_run_time() - base::TimeTicks::Now(); > > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > > To avoid possible weird bugs I recommend making this negative. > > > > > > > > > > > > Why negative result will avoid weird bug, is it because the > overflow > > > > when > > > > > > desired_run_time is less than current time? > > > > > > > > > > > > How about I just make sure it always return non-negative number? > > > > > > > > > > Sorry, my comment was really bad here. I meant it seems less error > prone > > > > to > > > > > ensure this doesn't go negative. But I think TimeDelta hides that, > so > > > > ignore > > > > > this comment. Sorry. > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h > > > > > File chrome/browser/ui/views/profiles/force_signout_dialog.h > (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode28 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:28: class > > > > > ForceSignoutDialog : public views::DialogDelegateView { > > > > > On 2017/06/06 21:00:44, zmin wrote: > > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > > WDYT of naming this ReauthenticateDialog? > > > > > > > > > > > > There're lots of different situations requires reauth, how about > > > > > > ForceReauthenticateDialog > > > > > > > > > > ForcedReauthenticationDialog? > > > > Sure, I can do that. > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/diff/360001/ > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h#newcode34 > > > > > chrome/browser/ui/views/profiles/force_signout_dialog.h:34: > base::Timer* > > > > > close_timer); > > > > > On 2017/06/06 21:00:43, zmin wrote: > > > > > > On 2017/06/05 23:43:18, sky wrote: > > > > > > > Document ownership. Also, why does the caller need to supply a > timer? > > > > > > > > > > > > The |close_timer| is used to track the remaining time mainly. > > > > > > It will also be used to > > > > > > 1) Stop the timer if there is no opened browser window as we can > sign > > > > out > > > > user > > > > > > without delay. > > > > > > 2) Close the dialog if the timer is stopped > > > > > > > > > > I get that you want a close_timer, but why does it need to be > passed in? > > > > Can't > > > > > the dialog own and creates it's own timer? > > > > > > > > close_timer(5 minutes countdown) will continue after user close the > > > > dialog. > > > > So at least dialog can't own the timer. > > > > > > > > > > Why does that mean the dialog needs to share the same timer? If the > caller > > > needs to maintain a timer, can't it do that? > > > > > > -Scott > > > > I share the timer so that the dialog and caller will share the exactly > same > > timestamp. > > > > If this is no necessary, I think the dialog shouldn't care about the > timer at > > all. > > The caller will tell the dialog the duration of countdown. > > Dialog use this duration to display the time remaining and dismiss itself > after > > that. > > The duration will be controlled by caller for different situation. > For example, if Chrome was just launched a second ago, there is no need to > give > full five minutes > countdown. I have chatted this with the UX. > > > > > > > > > > > > > > > > > > > https://codereview.chromium.org/2862653002/ > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Chromium-reviews" group. > > > To unsubscribe from this group and stop receiving emails from it, send > an > > email > > > to mailto:chromium-reviews+unsubscribe@chromium.org. > > > > https://codereview.chromium.org/2862653002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc:120: if (GetTimeRemaining() < base::TimeDelta::FromSeconds(kCloseDirectlyTimer)) { Is this conditional still needed? Isn't the supplied duration all you care about? https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc:150: else no else after return (see chrome style guide). https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h (right): https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h:34: int countdown_duration); Use TimeDelta, it's less ambiguous as to what the units are.
https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc (right): https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc:120: if (GetTimeRemaining() < base::TimeDelta::FromSeconds(kCloseDirectlyTimer)) { On 2017/06/07 20:37:59, sky wrote: > Is this conditional still needed? Isn't the supplied duration all you care > about? I need this to control the behavior of confirm dialog. Normally, when user confirm the dialog, I'll pop up the reauth dialog directly. However, if there're only few seconds left, user properly won't have enough time to finish the sign in. I'll close all windows before let user sign in again instead to avoid the situation that browser windows closed when user trying to sign in back. https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.cc:150: else On 2017/06/07 20:37:59, sky wrote: > no else after return (see chrome style guide). Done. https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h (right): https://codereview.chromium.org/2862653002/diff/420001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h:34: int countdown_duration); On 2017/06/07 20:37:59, sky wrote: > Use TimeDelta, it's less ambiguous as to what the units are. Done.
LGTM https://codereview.chromium.org/2862653002/diff/440001/chrome/browser/ui/view... File chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h (right): https://codereview.chromium.org/2862653002/diff/440001/chrome/browser/ui/view... chrome/browser/ui/views/profiles/forced_reauthentication_dialog.h:60: base::TimeTicks desired_close_time_; const
zmin@chromium.org changed reviewers: + jwd@chromium.org, rogerta@chromium.org
+rogerta@ for components/signin/core/browser/signin_metrics.h +jwd@ for tools/metrics/actions/actions.xml
lgtm components/signin/core/browser/signin_metrics.h
LGTM with nit https://codereview.chromium.org/2862653002/diff/440001/tools/metrics/actions/... File tools/metrics/actions/actions.xml (right): https://codereview.chromium.org/2862653002/diff/440001/tools/metrics/actions/... tools/metrics/actions/actions.xml:15400: Recorded when user sign in again from force sign in auth error warning modal nit: -> Record when a user signs in again from the force sign in...
The CQ bit was checked by zmin@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rogerta@chromium.org, sky@chromium.org, jwd@chromium.org Link to the patchset: https://codereview.chromium.org/2862653002/#ps460001 (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": 460001, "attempt_start_ts": 1496955151486040, "parent_rev": "9b40ada69660b42c0261c2830d6f2215d0a6f1f4", "commit_rev": "4dc68137b9724480cf6e055d24cbff75458a114e"}
Message was sent while issue was closed.
Description was changed from ========== If force-sign-in policy is enabled, popup warning dialog before window closing if auth token become invalid. Screenshots: https://goo.gl/photos/3KiQsSAPTse5brR89 https://goo.gl/photos/1jdyC86dSSyZVdi8A BUG=642059 ========== to ========== If force-sign-in policy is enabled, popup warning dialog before window closing if auth token become invalid. Screenshots: https://goo.gl/photos/3KiQsSAPTse5brR89 https://goo.gl/photos/1jdyC86dSSyZVdi8A BUG=642059 Review-Url: https://codereview.chromium.org/2862653002 Cr-Commit-Position: refs/heads/master@{#478124} Committed: https://chromium.googlesource.com/chromium/src/+/4dc68137b9724480cf6e055d24cb... ==========
Message was sent while issue was closed.
Committed patchset #16 (id:460001) as https://chromium.googlesource.com/chromium/src/+/4dc68137b9724480cf6e055d24cb... |