forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersistent_window_info.cc
32 lines (24 loc) · 1019 Bytes
/
persistent_window_info.cc
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
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/display/persistent_window_info.h"
#include "ash/wm/window_state.h"
#include "ui/aura/window.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
namespace ash {
PersistentWindowInfo::PersistentWindowInfo(aura::Window* window) {
const auto& display =
display::Screen::GetScreen()->GetDisplayNearestWindow(window);
window_bounds_in_screen = window->GetBoundsInScreen();
display_id = display.id();
display_bounds_in_screen = display.bounds();
WindowState* window_state = WindowState::Get(window);
DCHECK(window_state);
if (window_state->HasRestoreBounds())
restore_bounds_in_screen = window_state->GetRestoreBoundsInScreen();
}
PersistentWindowInfo::PersistentWindowInfo(const PersistentWindowInfo& other) =
default;
PersistentWindowInfo::~PersistentWindowInfo() = default;
} // namespace ash