1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29

ash / keyboard / ui / queued_container_type.cc [blame]

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/keyboard/ui/queued_container_type.h"

#include <utility>

#include "ash/keyboard/ui/keyboard_ui_controller.h"

namespace keyboard {

QueuedContainerType::QueuedContainerType(
    KeyboardUIController* controller,
    ContainerType container_type,
    gfx::Rect bounds,
    base::OnceCallback<void(bool success)> callback)
    : controller_(controller),
      container_type_(container_type),
      bounds_(bounds),
      callback_(std::move(callback)) {}

QueuedContainerType::~QueuedContainerType() {
  bool change_successful =
      controller_->GetActiveContainerType() == container_type_;
  std::move(callback_).Run(change_successful);
}

}  // namespace keyboard