Commit 3969a2c6 authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS systray: Remove some unused code paths (root window observing)

Change-Id: Icab080ad2cffd4b0e46c4075c2bb0c23beca9e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079254Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745482}
parent 01748f5e
...@@ -353,12 +353,6 @@ void TrayBackgroundView::UpdateAfterLoginStatusChange() { ...@@ -353,12 +353,6 @@ void TrayBackgroundView::UpdateAfterLoginStatusChange() {
// Handled in subclasses. // Handled in subclasses.
} }
void TrayBackgroundView::UpdateAfterRootWindowBoundsChange(
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) {
// Do nothing by default. Child class may do something.
}
void TrayBackgroundView::UpdateAfterStatusAreaCollapseChange() { void TrayBackgroundView::UpdateAfterStatusAreaCollapseChange() {
// We call the base class' SetVisible to skip animations. // We call the base class' SetVisible to skip animations.
views::View::SetVisible(GetEffectiveVisibility()); views::View::SetVisible(GetEffectiveVisibility());
......
...@@ -73,10 +73,6 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, ...@@ -73,10 +73,6 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Called to update the tray button after the login status changes. // Called to update the tray button after the login status changes.
virtual void UpdateAfterLoginStatusChange(); virtual void UpdateAfterLoginStatusChange();
// Called whenever the bounds of the root window changes.
virtual void UpdateAfterRootWindowBoundsChange(const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds);
// Called whenever the status area's collapse state changes. // Called whenever the status area's collapse state changes.
virtual void UpdateAfterStatusAreaCollapseChange(); virtual void UpdateAfterStatusAreaCollapseChange();
......
...@@ -29,8 +29,6 @@ TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray, ...@@ -29,8 +29,6 @@ TrayBubbleWrapper::TrayBubbleWrapper(TrayBackgroundView* tray,
tray->tray_event_filter()->AddBubble(this); tray->tray_event_filter()->AddBubble(this);
bubble_widget_->GetNativeWindow()->GetRootWindow()->AddObserver(this);
if (!is_persistent_) if (!is_persistent_)
Shell::Get()->activation_client()->AddObserver(this); Shell::Get()->activation_client()->AddObserver(this);
} }
...@@ -47,7 +45,6 @@ TrayBubbleWrapper::~TrayBubbleWrapper() { ...@@ -47,7 +45,6 @@ TrayBubbleWrapper::~TrayBubbleWrapper() {
for (auto* window : transient_manager->transient_children()) for (auto* window : transient_manager->transient_children())
transient_manager->RemoveTransientChild(window); transient_manager->RemoveTransientChild(window);
} }
bubble_widget_->GetNativeWindow()->GetRootWindow()->RemoveObserver(this);
bubble_widget_->RemoveObserver(this); bubble_widget_->RemoveObserver(this);
bubble_widget_->Close(); bubble_widget_->Close();
} }
...@@ -65,13 +62,6 @@ views::Widget* TrayBubbleWrapper::GetBubbleWidget() const { ...@@ -65,13 +62,6 @@ views::Widget* TrayBubbleWrapper::GetBubbleWidget() const {
return bubble_widget_; return bubble_widget_;
} }
void TrayBubbleWrapper::OnWidgetClosing(views::Widget* widget) {
CHECK_EQ(bubble_widget_, widget);
// Remove this from the observer list before the widget is closed and detached
// from the root window.
bubble_widget_->GetNativeWindow()->GetRootWindow()->RemoveObserver(this);
}
void TrayBubbleWrapper::OnWidgetDestroying(views::Widget* widget) { void TrayBubbleWrapper::OnWidgetDestroying(views::Widget* widget) {
CHECK_EQ(bubble_widget_, widget); CHECK_EQ(bubble_widget_, widget);
bubble_widget_->RemoveObserver(this); bubble_widget_->RemoveObserver(this);
...@@ -92,13 +82,6 @@ void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget, ...@@ -92,13 +82,6 @@ void TrayBubbleWrapper::OnWidgetBoundsChanged(views::Widget* widget,
tray_->BubbleResized(bubble_view_); tray_->BubbleResized(bubble_view_);
} }
void TrayBubbleWrapper::OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) {
tray_->UpdateAfterRootWindowBoundsChange(old_bounds, new_bounds);
}
void TrayBubbleWrapper::OnWindowActivated(ActivationReason reason, void TrayBubbleWrapper::OnWindowActivated(ActivationReason reason,
aura::Window* gained_active, aura::Window* gained_active,
aura::Window* lost_active) { aura::Window* lost_active) {
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/system/tray/tray_bubble_base.h" #include "ash/system/tray/tray_bubble_base.h"
#include "base/macros.h" #include "base/macros.h"
#include "ui/aura/window_observer.h"
#include "ui/views/widget/widget_observer.h" #include "ui/views/widget/widget_observer.h"
#include "ui/wm/public/activation_change_observer.h" #include "ui/wm/public/activation_change_observer.h"
...@@ -21,7 +20,6 @@ class TrayBubbleView; ...@@ -21,7 +20,6 @@ class TrayBubbleView;
// TODO(tetsui): Remove this and use TrayBubbleBase for all bubbles. // TODO(tetsui): Remove this and use TrayBubbleBase for all bubbles.
class ASH_EXPORT TrayBubbleWrapper : public TrayBubbleBase, class ASH_EXPORT TrayBubbleWrapper : public TrayBubbleBase,
public views::WidgetObserver, public views::WidgetObserver,
public aura::WindowObserver,
public ::wm::ActivationChangeObserver { public ::wm::ActivationChangeObserver {
public: public:
TrayBubbleWrapper(TrayBackgroundView* tray, TrayBubbleWrapper(TrayBackgroundView* tray,
...@@ -35,17 +33,10 @@ class ASH_EXPORT TrayBubbleWrapper : public TrayBubbleBase, ...@@ -35,17 +33,10 @@ class ASH_EXPORT TrayBubbleWrapper : public TrayBubbleBase,
views::Widget* GetBubbleWidget() const override; views::Widget* GetBubbleWidget() const override;
// views::WidgetObserver overrides: // views::WidgetObserver overrides:
void OnWidgetClosing(views::Widget* widget) override;
void OnWidgetDestroying(views::Widget* widget) override; void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetBoundsChanged(views::Widget* widget, void OnWidgetBoundsChanged(views::Widget* widget,
const gfx::Rect& new_bounds) override; const gfx::Rect& new_bounds) override;
// aura::WindowObserver:
void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) override;
// ::wm::ActivationChangeObserver overrides: // ::wm::ActivationChangeObserver overrides:
void OnWindowActivated(ActivationReason reason, void OnWindowActivated(ActivationReason reason,
aura::Window* gained_active, aura::Window* gained_active,
......
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