Commit 1017a659 authored by David Black's avatar David Black Committed by Chromium LUCI CQ

Remove ink drop hover treatment from holding space item views.

Per UX instructions, the only UI appearing on hover should be the pin.

Bug: 1166920
Change-Id: Ibdda78b1a60e83ec62ac381b30212dc57854c82e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631452Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#843906}
parent 66237dda
......@@ -19,10 +19,8 @@
#include "ui/gfx/color_palette.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/painter.h"
#include "ui/views/style/platform_style.h"
......@@ -120,21 +118,6 @@ HoldingSpaceItemView::HoldingSpaceItemView(
&HoldingSpaceItemView::OnPaintSelect, base::Unretained(this)));
layer()->Add(selected_layer_owner_->layer());
// Ink drop.
// Note that `ink_drop_container_` is added to the view hierarchy to parent
// any created ink drop layers. This will allow ink drop layers to animate
// in/out with the layer for this view as well as fix a crash in which ink
// drop layers were attempted to be reordered during destruction of this view.
ink_drop_container_ =
AddChildView(std::make_unique<views::InkDropContainerView>());
SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
SetInkDropVisibleOpacity(
AshColorProvider::Get()->GetRippleAttributes().inkdrop_opacity);
// Ink drop layers should match the corner radius of this view.
views::InstallRoundRectHighlightPathGenerator(this, gfx::Insets(),
kHoldingSpaceCornerRadius);
delegate_->OnHoldingSpaceItemViewCreated(this);
}
......@@ -151,29 +134,10 @@ bool HoldingSpaceItemView::IsInstance(views::View* view) {
return view->GetProperty(kIsHoldingSpaceItemViewProperty);
}
void HoldingSpaceItemView::AddLayerBeneathView(ui::Layer* layer) {
ink_drop_container_->AddInkDropLayer(layer);
}
void HoldingSpaceItemView::RemoveLayerBeneathView(ui::Layer* layer) {
ink_drop_container_->RemoveInkDropLayer(layer);
}
SkColor HoldingSpaceItemView::GetInkDropBaseColor() const {
return AshColorProvider::Get()->GetRippleAttributes().base_color;
}
bool HoldingSpaceItemView::HandleAccessibleAction(
const ui::AXActionData& action_data) {
return delegate_->OnHoldingSpaceItemViewAccessibleAction(this, action_data) ||
views::InkDropHostView::HandleAccessibleAction(action_data);
}
void HoldingSpaceItemView::Layout() {
views::InkDropHostView::Layout();
// Ink drop bounds should always match the bounds for this view.
ink_drop_container_->SetSize(size());
views::View::HandleAccessibleAction(action_data);
}
void HoldingSpaceItemView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
......@@ -215,7 +179,7 @@ void HoldingSpaceItemView::OnMouseEvent(ui::MouseEvent* event) {
default:
break;
}
views::InkDropHostView::OnMouseEvent(event);
views::View::OnMouseEvent(event);
}
bool HoldingSpaceItemView::OnMousePressed(const ui::MouseEvent& event) {
......@@ -355,7 +319,7 @@ void HoldingSpaceItemView::UpdatePin() {
OnPinVisiblityChanged(true);
}
BEGIN_METADATA(HoldingSpaceItemView, views::InkDropHostView)
BEGIN_METADATA(HoldingSpaceItemView, views::View)
END_METADATA
} // namespace ash
......@@ -11,11 +11,10 @@
#include "ash/public/cpp/holding_space/holding_space_model.h"
#include "ash/public/cpp/holding_space/holding_space_model_observer.h"
#include "base/scoped_observation.h"
#include "ui/views/animation/ink_drop_host_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/view.h"
namespace views {
class InkDropContainerView;
class ToggleImageButton;
} // namespace views
......@@ -28,7 +27,7 @@ class HoldingSpaceItemViewDelegate;
// `HoldingSpaceItemScreenCaptureView`. Note that `HoldingSpaceItemView` may
// temporarily outlive its associated `HoldingSpaceItem` when it is being
// animated out.
class ASH_EXPORT HoldingSpaceItemView : public views::InkDropHostView,
class ASH_EXPORT HoldingSpaceItemView : public views::View,
public HoldingSpaceModelObserver {
public:
METADATA_HEADER(HoldingSpaceItemView);
......@@ -45,12 +44,8 @@ class ASH_EXPORT HoldingSpaceItemView : public views::InkDropHostView,
// Returns if `view` is an instance of `HoldingSpaceItemView`.
static bool IsInstance(views::View* view);
// views::InkDropHostView:
void AddLayerBeneathView(ui::Layer* layer) override;
void RemoveLayerBeneathView(ui::Layer* layer) override;
SkColor GetInkDropBaseColor() const override;
// views::View:
bool HandleAccessibleAction(const ui::AXActionData& action_data) override;
void Layout() override;
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void OnFocus() override;
void OnBlur() override;
......@@ -94,7 +89,6 @@ class ASH_EXPORT HoldingSpaceItemView : public views::InkDropHostView,
const std::string item_id_;
// Owned by view hierarchy.
views::InkDropContainerView* ink_drop_container_ = nullptr;
views::ToggleImageButton* pin_ = nullptr;
// Owners for the layers used to paint focused and selected states.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment