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

Unified Diff: ash/common/wm/workspace/workspace_layout_manager.cc

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/common/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/common/wm/workspace/workspace_layout_manager.cc b/ash/common/wm/workspace/workspace_layout_manager.cc
index e1a19c7f1765990432d44a3fbb2766a4fd59ac28..c8cf2f3865d537bf33751507ec2f28c645afd0e2 100644
--- a/ash/common/wm/workspace/workspace_layout_manager.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager.cc
@@ -8,6 +8,7 @@
#include "ash/common/ash_switches.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm/always_on_top_controller.h"
#include "ash/common/wm/fullscreen_window_finder.h"
#include "ash/common/wm/window_positioner.h"
@@ -15,7 +16,6 @@
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
#include "ash/common/wm/workspace/workspace_layout_manager_backdrop_delegate.h"
-#include "ash/common/wm/workspace/workspace_layout_manager_delegate.h"
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
@@ -27,14 +27,11 @@
namespace ash {
-WorkspaceLayoutManager::WorkspaceLayoutManager(
- WmWindow* window,
- std::unique_ptr<wm::WorkspaceLayoutManagerDelegate> delegate)
+WorkspaceLayoutManager::WorkspaceLayoutManager(WmWindow* window)
: window_(window),
root_window_(window->GetRootWindow()),
root_window_controller_(root_window_->GetRootWindowController()),
shell_(window_->GetShell()),
- delegate_(std::move(delegate)),
work_area_in_parent_(wm::GetDisplayWorkAreaBounds(window_)),
is_fullscreen_(wm::GetWindowForFullscreenMode(window) != nullptr) {
shell_->AddShellObserver(this);
@@ -58,10 +55,6 @@ WorkspaceLayoutManager::~WorkspaceLayoutManager() {
shell_->RemoveShellObserver(this);
}
-void WorkspaceLayoutManager::DeleteDelegate() {
- delegate_.reset();
-}
-
void WorkspaceLayoutManager::SetMaximizeBackdropDelegate(
std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate) {
backdrop_delegate_.reset(delegate.release());
@@ -345,8 +338,8 @@ void WorkspaceLayoutManager::AdjustAllWindowsBoundsForWorkAreaChange(
}
void WorkspaceLayoutManager::UpdateShelfVisibility() {
- if (delegate_)
- delegate_->UpdateShelfVisibility();
+ if (root_window_controller_->GetShelf())
James Cook 2016/08/10 19:55:41 Maybe this should be HasShelf()? I'm not sure. It
msw 2016/08/10 20:47:40 Done.
+ root_window_controller_->GetShelf()->UpdateVisibilityState();
}
void WorkspaceLayoutManager::UpdateFullscreenState() {
@@ -355,11 +348,9 @@ void WorkspaceLayoutManager::UpdateFullscreenState() {
// only windows in the default workspace container will go fullscreen but
// this should really be tracked by the RootWindowController since
// technically any container could get a fullscreen window.
- if (!delegate_)
- return;
bool is_fullscreen = wm::GetWindowForFullscreenMode(window_) != nullptr;
if (is_fullscreen != is_fullscreen_) {
- delegate_->OnFullscreenStateChanged(is_fullscreen);
+ WmShell::Get()->NotifyFullscreenStateChanged(is_fullscreen, root_window_);
is_fullscreen_ = is_fullscreen;
}
}

Powered by Google App Engine
This is Rietveld 408576698