queued_container_type.cc 848 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2018 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. #include "ash/keyboard/ui/queued_container_type.h"
  5. #include <utility>
  6. #include "ash/keyboard/ui/keyboard_ui_controller.h"
  7. namespace keyboard {
  8. QueuedContainerType::QueuedContainerType(
  9. KeyboardUIController* controller,
  10. ContainerType container_type,
  11. gfx::Rect bounds,
  12. base::OnceCallback<void(bool success)> callback)
  13. : controller_(controller),
  14. container_type_(container_type),
  15. bounds_(bounds),
  16. callback_(std::move(callback)) {}
  17. QueuedContainerType::~QueuedContainerType() {
  18. bool change_successful =
  19. controller_->GetActiveContainerType() == container_type_;
  20. std::move(callback_).Run(change_successful);
  21. }
  22. } // namespace keyboard