0
Files
src/content/common/common_param_traits_macros.h
Sinan Sahin 92a360bc45 [Offline indicator v2] Add minimum height concept for browser controls
Right now, top and bottom browser controls can have a shown ratio
between 0 and 1. This CL adds the ability to set a minimum height for
either. Once set, the browser controls will not completely scroll off
the screen, but will stop scrolling once the controls' visible height
reaches a min height. A minimum shown ratio is calculated in
blink::BrowserControls or cc::BrowserControlsOffsetManager using the
min-height. This minimum shown ratio is then used to limit the shown
ratio of the browser controls when scrolling.

This particular CL adds the plumbing to get the minimum height from
Java to (blink and cc) browser controls. Apart from the height and min
heights, an "animate" bit is also sent from Java to native side. If
animate is true, cc::BCOM will animate the changes to the height and/or
min height of the browser controls. The actual animation logic will be
added in an upcoming CL.

Having a minimum height will give us an area to put a persistent
Android view above the omnibox that won't scroll off.

Bug: 989148
Change-Id: I123bcd2a089e20191d5416158eb8a4fe1449d6ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918262
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#722140}
2019-12-05 19:20:45 +00:00

63 lines
2.7 KiB
C

// Copyright 2019 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.
// Singly or Multiply-included shared traits file depending on circumstances.
// This allows the use of IPC serialization macros in more than one IPC message
// file.
#ifndef CONTENT_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
#define CONTENT_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
#include "cc/trees/browser_controls_params.h"
#include "content/common/frame_messages.h"
#include "content/common/visual_properties.h"
#include "ipc/ipc_message_macros.h"
#include "third_party/blink/public/web/web_device_emulation_params.h"
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
// Traits for VisualProperties.
IPC_ENUM_TRAITS_MAX_VALUE(blink::WebDeviceEmulationParams::ScreenPosition,
blink::WebDeviceEmulationParams::kScreenPositionLast)
IPC_ENUM_TRAITS_MAX_VALUE(content::ScreenOrientationValues,
content::SCREEN_ORIENTATION_VALUES_LAST)
IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebScreenOrientationType,
blink::kWebScreenOrientationUndefined,
blink::WebScreenOrientationTypeLast)
IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::DisplayMode,
blink::mojom::DisplayMode::kMaxValue)
IPC_STRUCT_TRAITS_BEGIN(cc::BrowserControlsParams)
IPC_STRUCT_TRAITS_MEMBER(top_controls_height)
IPC_STRUCT_TRAITS_MEMBER(top_controls_min_height)
IPC_STRUCT_TRAITS_MEMBER(bottom_controls_height)
IPC_STRUCT_TRAITS_MEMBER(bottom_controls_min_height)
IPC_STRUCT_TRAITS_MEMBER(animate_browser_controls_height_changes)
IPC_STRUCT_TRAITS_MEMBER(browser_controls_shrink_blink_size)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(content::VisualProperties)
IPC_STRUCT_TRAITS_MEMBER(screen_info)
IPC_STRUCT_TRAITS_MEMBER(auto_resize_enabled)
IPC_STRUCT_TRAITS_MEMBER(min_size_for_auto_resize)
IPC_STRUCT_TRAITS_MEMBER(max_size_for_auto_resize)
IPC_STRUCT_TRAITS_MEMBER(new_size)
IPC_STRUCT_TRAITS_MEMBER(visible_viewport_size)
IPC_STRUCT_TRAITS_MEMBER(compositor_viewport_pixel_rect)
IPC_STRUCT_TRAITS_MEMBER(browser_controls_params)
IPC_STRUCT_TRAITS_MEMBER(scroll_focused_node_into_view)
IPC_STRUCT_TRAITS_MEMBER(local_surface_id_allocation)
IPC_STRUCT_TRAITS_MEMBER(is_fullscreen_granted)
IPC_STRUCT_TRAITS_MEMBER(display_mode)
IPC_STRUCT_TRAITS_MEMBER(capture_sequence_number)
IPC_STRUCT_TRAITS_MEMBER(zoom_level)
IPC_STRUCT_TRAITS_MEMBER(page_scale_factor)
IPC_STRUCT_TRAITS_MEMBER(is_pinch_gesture_active)
IPC_STRUCT_TRAITS_END()
#endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_MACROS_H_