Commit 0b2a72c1 authored by Shengsong Tan's avatar Shengsong Tan Committed by Chromium LUCI CQ

Adding metadata to OverviewButtonTray

This is part of the "Views Posse" effort. See this document:
https://docs.google.com/document/d/1Rst3792TjXtVA8k8GXaPD8MnuB1JAneSOpIILdA4268/edit?usp=sharing

Bug: 1159562
Test: build
Change-Id: Ifdff40cd0fc2a03e01c48accac9b452c55ff3ea3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600421Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Shengsong Tan <sstan@google.com>
Cr-Commit-Position: refs/heads/master@{#839039}
parent cf7241e5
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "ui/views/animation/ink_drop.h" #include "ui/views/animation/ink_drop.h"
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/wm/core/window_util.h" #include "ui/wm/core/window_util.h"
namespace ash { namespace ash {
...@@ -187,10 +188,6 @@ void OverviewButtonTray::HideBubbleWithView(const TrayBubbleView* bubble_view) { ...@@ -187,10 +188,6 @@ void OverviewButtonTray::HideBubbleWithView(const TrayBubbleView* bubble_view) {
// This class has no bubbles to hide. // This class has no bubbles to hide.
} }
const char* OverviewButtonTray::GetClassName() const {
return "OverviewButtonTray";
}
void OverviewButtonTray::UpdateIconVisibility() { void OverviewButtonTray::UpdateIconVisibility() {
// The visibility of the OverviewButtonTray has diverged from // The visibility of the OverviewButtonTray has diverged from
// OverviewController::CanSelect. The visibility of the button should // OverviewController::CanSelect. The visibility of the button should
...@@ -211,4 +208,7 @@ void OverviewButtonTray::UpdateIconVisibility() { ...@@ -211,4 +208,7 @@ void OverviewButtonTray::UpdateIconVisibility() {
!app_mode); !app_mode);
} }
BEGIN_METADATA(OverviewButtonTray, TrayBackgroundView)
END_METADATA
} // namespace ash } // namespace ash
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "ash/wm/overview/overview_observer.h" #include "ash/wm/overview/overview_observer.h"
#include "base/macros.h" #include "base/macros.h"
#include "ui/events/event_constants.h" #include "ui/events/event_constants.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace views { namespace views {
class ImageView; class ImageView;
...@@ -31,6 +32,8 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView, ...@@ -31,6 +32,8 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView,
public TabletModeObserver, public TabletModeObserver,
public ShelfConfig::Observer { public ShelfConfig::Observer {
public: public:
METADATA_HEADER(OverviewButtonTray);
// Second taps within this time will be counted as double taps. Use this // Second taps within this time will be counted as double taps. Use this
// instead of ui::Event's click_count and tap_count as those have a minimum // instead of ui::Event's click_count and tap_count as those have a minimum
// time bewtween events before the second tap counts as a double tap. // time bewtween events before the second tap counts as a double tap.
...@@ -41,6 +44,8 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView, ...@@ -41,6 +44,8 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView,
base::TimeDelta::FromMilliseconds(300); base::TimeDelta::FromMilliseconds(300);
explicit OverviewButtonTray(Shelf* shelf); explicit OverviewButtonTray(Shelf* shelf);
OverviewButtonTray(const OverviewButtonTray&) = delete;
OverviewButtonTray& operator=(const OverviewButtonTray&) = delete;
~OverviewButtonTray() override; ~OverviewButtonTray() override;
// Sets the ink drop ripple to ACTIVATED immediately with no animations. // Sets the ink drop ripple to ACTIVATED immediately with no animations.
...@@ -74,9 +79,6 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView, ...@@ -74,9 +79,6 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView,
void HandleLocaleChange() override; void HandleLocaleChange() override;
void HideBubbleWithView(const TrayBubbleView* bubble_view) override; void HideBubbleWithView(const TrayBubbleView* bubble_view) override;
// views::View:
const char* GetClassName() const override;
private: private:
friend class OverviewButtonTrayTest; friend class OverviewButtonTrayTest;
...@@ -92,8 +94,6 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView, ...@@ -92,8 +94,6 @@ class ASH_EXPORT OverviewButtonTray : public TrayBackgroundView,
// Stores the timestamp of the last tap event time that happened while not // Stores the timestamp of the last tap event time that happened while not
// in overview mode. Used to check for double taps, which invoke quick switch. // in overview mode. Used to check for double taps, which invoke quick switch.
base::Optional<base::TimeTicks> last_press_event_time_; base::Optional<base::TimeTicks> last_press_event_time_;
DISALLOW_COPY_AND_ASSIGN(OverviewButtonTray);
}; };
} // namespace ash } // namespace ash
......
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