blob: 306bbdb86512c4df9e1d292a74b6e17f5b498b5c [file] [log] [blame]
// Copyright 2015 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 "build/build_config.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/size.h"
enum LayoutConstant {
// The minimum height of Bookmarks Bar, when attached to the toolbar. The
// height of the toolbar may grow to more than this value if the embedded
// views need more space, for example, when the font is larger than normal.
#if defined(OS_MACOSX)
// This is a little smaller than the bookmarkbar height because of the visual
// overlap with the main toolbar. This height should not be used when
// computing the height of the toolbar.
// The height of Bookmarks Bar, when visible in "New Tab Page" mode.
#if defined(OS_MACOSX)
// The amount of space between the inner bookmark bar and the outer toolbar on
// new tab pages.
// The size of the app menu button in a hosted app browser window.
// The vertical padding (additional to TOOLBAR_ELEMENT_PADDING) above and
// below location bar bubbles.
// The vertical padding between the edge of a location bar bubble and its
// contained text.
// The corner radius used for the location bar bubble.
// The vertical inset to apply to the bounds of a location bar bubble's anchor
// view, to bring the bubble closer to the anchor. This compensates for the
// space between the bottoms of most such views and the visible bottoms of the
// images inside.
// The horizontal padding between location bar decorations as well as the
// vertical and horizontal padding inside the border.
// The height to be occupied by the LocationBar.
// The size of the icons used inside the LocationBar.
// Padding after the tab title.
// Width of the alert indicator shown for a tab using media capture.
// Width of the alert indicator icon displayed in the tab. The same width is
// used for all 3 states of normal, hovered and pressed.
// The height of a tab, including outer strokes. In non-100% scales this is
// slightly larger than the apparent height of the tab, as the top stroke is
// drawn as a 1-px line flush with the bottom of the tab's topmost DIP.
// Padding before the tab title.
// The distance between the edge of one tab to the corresponding edge or the
// subsequent tab when tabs are stacked.
// The standard width of a tab when is stacked layout. This does not include
// the endcap width.
// The standard tab width excluding the overlap (which is the endcap width on
// one side)
// Additional horizontal padding between the elements in the toolbar.
// The horizontal space between most items in the toolbar.
enum LayoutInset {
// The padding used around the icon inside the LocationBar. The full width of
// the icon would be LOCATION_BAR_ICON_SIZE + 2 * inset.width(). The full
// height of the icon would be LOCATION_BAR_ICON_SIZE + 2 * inset.height().
// Icons may additionally be spaced horizontally by
// LOCATION_BAR_ELEMENT_PADDING, but this region is not part of the icon view
// (e.g. does not highlight on hover).
// The padding inside the tab bounds that defines the tab contents region.
// The padding inside the border of a toolbar button (around the image).
// The padding inside the border of a toolbar action view button.
enum LayoutSize {
// The visible size of the new tab button; does not include any Fitts' Law
// extensions. Note that in touch-optimized UI mode, the new tab button's
// width is larger when the browser is in incognito mode. The height remains
// the same whether incognito or not.
int GetLayoutConstant(LayoutConstant constant);
#if defined(OS_MACOSX)
// Use this function instead of GetLayoutConstant() for Cocoa browser.
// This will handle Cocoa specific layout constants. For non Cocoa specific
// constants, it will call GetLayoutConstant() anyway.
int GetCocoaLayoutConstant(LayoutConstant constant);
gfx::Insets GetLayoutInsets(LayoutInset inset);
gfx::Size GetLayoutSize(LayoutSize size, bool is_incognito);