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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
// 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.
#ifndef CHROMEOS_UI_FRAME_FRAME_UTILS_H_
#define CHROMEOS_UI_FRAME_FRAME_UTILS_H_
#include "base/component_export.h"
#include "chromeos/ui/base/window_state_type.h"
#include "chromeos/ui/frame/caption_buttons/snap_controller.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/views/widget/widget.h"
namespace gfx {
class Point;
} // namespace gfx
namespace views {
class NonClientFrameView;
}
namespace chromeos {
// Returns the HitTestCompat for the specified point.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
int FrameBorderNonClientHitTest(views::NonClientFrameView* view,
const gfx::Point& point_in_widget);
// Resolve the inferred opacity and updates the params.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
void ResolveInferredOpacity(views::Widget::InitParams* params);
// Checks whether we should draw the restored window frame on |widget|.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
bool ShouldUseRestoreFrame(const views::Widget* widget);
// Gets the snap direction given a button associated with left/top or
// right/bottom. Takes into account the orientation of the display.
SnapDirection GetSnapDirectionForWindow(aura::Window* window, bool left_top);
// Returns the radii of the window's corners based on its state.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
gfx::RoundedCornersF GetWindowRadii(const aura::Window* window);
// Returns true if the ClassProperty can effect the radius of the window.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
bool CanPropertyEffectWindowRadius(const void* class_property_key);
// Returns true if window should have rounded corners for a given
// `window_state`.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
bool ShouldWindowStateHaveRoundedCorners(WindowStateType window_state);
// Returns true if the `window` should have rounded corners.
COMPONENT_EXPORT(CHROMEOS_UI_FRAME)
bool ShouldWindowHaveRoundedCorners(const aura::Window* window);
} // namespace chromeos
#endif // CHROMEOS_UI_FRAME_FRAME_UTILS_H_
|