legacy_remove_query_confirmation_dialog.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2019 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_APP_LIST_VIEWS_LEGACY_REMOVE_QUERY_CONFIRMATION_DIALOG_H_
  5. #define ASH_APP_LIST_VIEWS_LEGACY_REMOVE_QUERY_CONFIRMATION_DIALOG_H_
  6. #include "base/callback.h"
  7. #include "ui/views/window/dialog_delegate.h"
  8. namespace ash {
  9. // LegacyRemoveQueryConfirmationDialog displays the confirmation dialog for
  10. // removing a recent query suggestion. Used for pre-productivity launcher UI.
  11. // When kProductivityLauncher feature is enabled, the UI for confirming
  12. // suggestion results uses `RemoveQueryConfirmationDialog`.
  13. class LegacyRemoveQueryConfirmationDialog : public views::DialogDelegateView {
  14. public:
  15. // Callback to notify user's confirmation for removing the zero state
  16. // suggestion query. Invoked with true if user confirms removing query
  17. // suggestion; and false for declining the removal. The second parameter is
  18. // the event flags of user action for invoking the removal action on the
  19. // associated result.
  20. using RemovalConfirmationCallback = base::OnceCallback<void(bool)>;
  21. LegacyRemoveQueryConfirmationDialog(RemovalConfirmationCallback callback,
  22. const std::u16string& result_title);
  23. LegacyRemoveQueryConfirmationDialog(
  24. const LegacyRemoveQueryConfirmationDialog&) = delete;
  25. LegacyRemoveQueryConfirmationDialog& operator=(
  26. const LegacyRemoveQueryConfirmationDialog&) = delete;
  27. ~LegacyRemoveQueryConfirmationDialog() override;
  28. // views::View:
  29. const char* GetClassName() const override;
  30. gfx::Size CalculatePreferredSize() const override;
  31. private:
  32. RemovalConfirmationCallback confirm_callback_;
  33. };
  34. } // namespace ash
  35. #endif // ASH_APP_LIST_VIEWS_LEGACY_REMOVE_QUERY_CONFIRMATION_DIALOG_H_