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
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42

ash / wm / splitview / split_view_test_api.cc [blame]

// Copyright 2019 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/public/cpp/split_view_test_api.h"

#include "ash/shell.h"
#include "ash/wm/splitview/split_view_controller.h"
#include "ash/wm/splitview/split_view_types.h"

namespace ash {

namespace {

SplitViewController* split_view_controller() {
  return SplitViewController::Get(Shell::GetPrimaryRootWindow());
}

}  // namespace

SplitViewTestApi::SplitViewTestApi() : controller_(split_view_controller()) {}

SplitViewTestApi::~SplitViewTestApi() = default;

void SplitViewTestApi::SnapWindow(aura::Window* window,
                                  SnapPosition snap_position) {
  controller_->SnapWindow(window, snap_position);
}

void SplitViewTestApi::SwapWindows() {
  controller_->SwapWindows();
}

aura::Window* SplitViewTestApi::GetPrimaryWindow() const {
  return controller_->primary_window();
}

aura::Window* SplitViewTestApi::GetSecondaryWindow() const {
  return controller_->secondary_window();
}

}  // namespace ash