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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_DELEGATE_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_DELEGATE_H_
#include <string>
#include "build/build_config.h"
#if BUILDFLAG(IS_LINUX)
#include "ui/base/ui_base_types.h"
#endif
namespace gfx {
class Size;
class Rect;
} // namespace gfx
// Delegate interface to control layout decisions without having to depend on
// Browser{,Frame,View}.
class OpaqueBrowserFrameViewLayoutDelegate {
public:
enum class FrameButtonStyle {
// MD-styled button with a vector image, of class FrameCaptionButton.
kMdButton,
// Regular old ImageButton.
kImageButton,
};
// Controls the visual placement of the window icon/title in non-tabstrip
// mode.
virtual bool ShouldShowWindowIcon() const = 0;
virtual bool ShouldShowWindowTitle() const = 0;
virtual std::u16string GetWindowTitle() const = 0;
// Returns the size of the window icon. This can be platform dependent
// because of differences in fonts, so its part of the interface.
virtual int GetIconSize() const = 0;
// Returns the browser's minimum view size. Used because we need to calculate
// the minimum size for the entire non-client area.
virtual gfx::Size GetBrowserViewMinimumSize() const = 0;
// Whether we should show the (minimize,maximize,close) buttons. This can
// depend on the current state of the window (e.g., whether it is maximized).
virtual bool ShouldShowCaptionButtons() const = 0;
// Returns true if in guest mode or a non off the record session.
virtual bool IsRegularOrGuestSession() const = 0;
// Controls window state.
virtual bool CanMaximize() const = 0;
virtual bool CanMinimize() const = 0;
virtual bool IsMaximized() const = 0;
virtual bool IsMinimized() const = 0;
virtual bool IsFullscreen() const = 0;
virtual bool GetBorderlessModeEnabled() const = 0;
virtual bool IsTabStripVisible() const = 0;
virtual int GetTabStripHeight() const = 0;
virtual bool IsToolbarVisible() const = 0;
// Returns the tabstrips minimum size so the frame layout can work around
// it.
virtual gfx::Size GetTabstripMinimumSize() const = 0;
// Computes the height of the top area of the frame.
virtual int GetTopAreaHeight() const = 0;
// Returns true if the window frame is rendered by Chrome.
virtual bool UseCustomFrame() const = 0;
// Determines whether the top frame is condensed vertically, as when the
// window is maximized. If true, the top frame is just the height of a tab,
// rather than having extra vertical space above the tabs. This also removes
// the thick frame border and rounded corners.
virtual bool IsFrameCondensed() const = 0;
// Returns whether the shapes of background tabs are visible against the frame
// for either active or inactive windows.
virtual bool EverHasVisibleBackgroundTabShapes() const = 0;
// Indicates the type of the frame buttons.
virtual FrameButtonStyle GetFrameButtonStyle() const;
virtual void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) = 0;
// Returns true if a client-side shadow should be drawn for restored windows.
virtual bool ShouldDrawRestoredFrameShadow() const = 0;
#if BUILDFLAG(IS_LINUX)
// Returns whether the window is in a tiled state.
virtual bool IsTiled() const = 0;
#endif
// Returns the (preferred) heights of buttons in the web app frame toolbar. If
// the toolbar isn't visible, this returns 0.
virtual int WebAppButtonHeight() const = 0;
protected:
virtual ~OpaqueBrowserFrameViewLayoutDelegate() = default;
};
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_DELEGATE_H_
|