teleport_warning_dialog.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SESSION_TELEPORT_WARNING_DIALOG_H_
  5. #define ASH_SESSION_TELEPORT_WARNING_DIALOG_H_
  6. #include "base/callback.h"
  7. #include "ui/views/window/dialog_delegate.h"
  8. namespace views {
  9. class Checkbox;
  10. }
  11. namespace ash {
  12. // Dialog for multi-profiles Window teleportation warning. When a user sends
  13. // ("teleports") a window to another user's desktop, this dialog confirms that
  14. // the user understands what that entails.
  15. class TeleportWarningDialog : public views::DialogDelegateView {
  16. public:
  17. // This callback and its parameters match ShowTeleportWarningDialogCallback.
  18. typedef base::OnceCallback<void(bool, bool)> OnAcceptCallback;
  19. explicit TeleportWarningDialog(OnAcceptCallback callback);
  20. TeleportWarningDialog(const TeleportWarningDialog&) = delete;
  21. TeleportWarningDialog& operator=(const TeleportWarningDialog&) = delete;
  22. ~TeleportWarningDialog() override;
  23. static void Show(OnAcceptCallback callback);
  24. // views::View overrides.
  25. gfx::Size CalculatePreferredSize() const override;
  26. private:
  27. void InitDialog();
  28. views::Checkbox* never_show_again_checkbox_;
  29. OnAcceptCallback on_accept_;
  30. };
  31. } // namespace ash
  32. #endif // ASH_SESSION_TELEPORT_WARNING_DIALOG_H_