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

Unified Diff: ash/root_window_controller.cc

Issue 2293183002: ash: Remove ash::Shelf in favor of ash::WmShelf (Closed)
Patch Set: rebase 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
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 5a093942fda37bdb38693fe3a2314921ebcbd3c9..7f2f0fefed9485c1c1f955450a3e3cdc67f6f125 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -16,7 +16,6 @@
#include "ash/common/login_status.h"
#include "ash/common/root_window_controller_common.h"
#include "ash/common/session/session_state_delegate.h"
-#include "ash/common/shelf/shelf.h"
#include "ash/common/shelf/shelf_delegate.h"
#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shelf/shelf_types.h"
@@ -464,24 +463,17 @@ const aura::Window* RootWindowController::GetContainer(int container_id) const {
}
void RootWindowController::ShowShelf() {
- if (!shelf_)
+ if (!wm_shelf_aura_->IsShelfCreated())
return;
+ // TODO(jamescook): Move this into WmShelf.
shelf_widget_->SetShelfVisibility(true);
shelf_widget_->status_area_widget()->Show();
}
void RootWindowController::CreateShelf() {
- if (shelf_)
+ if (wm_shelf_aura_->IsShelfCreated())
return;
- ShelfView* shelf_view = shelf_widget_->CreateShelfView();
-
- shelf_.reset(
- new Shelf(wm_shelf_aura_.get(), shelf_view, shelf_widget_.get()));
- shelf_widget_->set_shelf(shelf_.get());
- // Must be initialized before the delegate is notified because the delegate
- // may try to access the WmShelf.
- wm_shelf_aura_->SetShelf(shelf_.get());
- WmShell::Get()->shelf_delegate()->OnShelfCreated(wm_shelf_aura_.get());
+ wm_shelf_aura_->CreateShelf();
if (panel_layout_manager_)
panel_layout_manager_->SetShelf(wm_shelf_aura_.get());
@@ -499,10 +491,6 @@ void RootWindowController::CreateShelf() {
shelf_widget_->PostCreateShelf();
}
-Shelf* RootWindowController::GetShelf() const {
- return shelf_.get();
-}
-
void RootWindowController::UpdateAfterLoginStatusChange(LoginStatus status) {
if (status != LoginStatus::NOT_LOGGED_IN)
mouse_event_target_.reset();
@@ -613,10 +601,9 @@ void RootWindowController::CloseChildWindows() {
shelf_widget_.reset();
// CloseChildWindows may be called twice during the shutdown of ash unittests.
- // Avoid notifying WmShelf that the Shelf instance has been destroyed twice.
- if (wm_shelf_aura_->shelf())
- wm_shelf_aura_->ClearShelf();
- shelf_.reset();
+ // Avoid notifying WmShelf that the shelf has been destroyed twice.
+ if (wm_shelf_aura_->IsShelfCreated())
+ wm_shelf_aura_->DestroyShelf();
}
void RootWindowController::MoveWindowsTo(aura::Window* dst) {

Powered by Google App Engine
This is Rietveld 408576698