Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1905)

Unified Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2295003002: mash: Remove WmRootWindowControllerObserver. (Closed)
Patch Set: Address comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_layout_manager.cc
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index eb25188a57740c3bd8bb68986b69131f2f9fb495..ce74ac4de4c0cde119354c7027a7741e215c7569 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -23,7 +23,6 @@
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_root_window_controller.h"
-#include "ash/common/wm_root_window_controller_observer.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
#include "base/auto_reset.h"
@@ -106,42 +105,6 @@ class ShelfLayoutManager::UpdateShelfObserver
DISALLOW_COPY_AND_ASSIGN(UpdateShelfObserver);
};
-// ShelfLayoutManager::RootWindowControllerObserverImpl ------------------------
-
-// NOTE: Some other layout managers also observe for OnShelfAlignmentChanged()
-// via WmRootWindowControllerObserver instead of via ShellObserver. There are
-// implicit assumptions that these layout managers run in order. In order to
-// preserve the ordering, OnShelfAlignmentChanged() is implemented here in terms
-// of a WmRootWindowControllerObserver instead of a ShellObserver. This gives us
-// a sane ordering (or at least ordering as we've always had it in ash).
-class ShelfLayoutManager::RootWindowControllerObserverImpl
- : public WmRootWindowControllerObserver {
- public:
- explicit RootWindowControllerObserverImpl(
- ShelfLayoutManager* shelf_layout_manager)
- : shelf_layout_manager_(shelf_layout_manager),
- root_window_controller_(
- WmLookup::Get()
- ->GetWindowForWidget(shelf_layout_manager->shelf_widget())
- ->GetRootWindowController()) {
- root_window_controller_->AddObserver(this);
- }
- ~RootWindowControllerObserverImpl() override {
- root_window_controller_->RemoveObserver(this);
- }
-
- // WmRootWindowControllerObserver:
- void OnShelfAlignmentChanged() override {
- shelf_layout_manager_->LayoutShelf();
- }
-
- private:
- ShelfLayoutManager* shelf_layout_manager_;
- WmRootWindowController* root_window_controller_;
-
- DISALLOW_COPY_AND_ASSIGN(RootWindowControllerObserverImpl);
-};
-
// ShelfLayoutManager ----------------------------------------------------------
ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf_widget,
@@ -156,9 +119,7 @@ ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf_widget,
gesture_drag_auto_hide_state_(SHELF_AUTO_HIDE_SHOWN),
update_shelf_observer_(NULL),
chromevox_panel_height_(0),
- duration_override_in_ms_(0),
- root_window_controller_observer_(
- new RootWindowControllerObserverImpl(this)) {
+ duration_override_in_ms_(0) {
DCHECK(shelf_widget_);
DCHECK(wm_shelf_);
WmShell::Get()->AddShellObserver(this);
« no previous file with comments | « ash/common/shelf/shelf_layout_manager.h ('k') | ash/common/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698