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

Unified Diff: ash/mus/workspace/workspace_layout_manager_unittest.cc

Issue 2234033002: mash: Remove WorkspaceLayoutManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove WmRootWindowControllerObserver::OnFullscreenStateChanged; use ShellObserver. 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/mus/root_window_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/mus/workspace/workspace_layout_manager_unittest.cc b/ash/mus/workspace/workspace_layout_manager_unittest.cc
index 5c2f5d7d6c010e2055897729d9308c6e83174109..61a9f60fe21c01285835c60277414fcadebaa2d4 100644
--- a/ash/mus/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/mus/workspace/workspace_layout_manager_unittest.cc
@@ -7,11 +7,12 @@
#include <string>
#include <utility>
+#include "ash/common/shell_observer.h"
#include "ash/common/wm/fullscreen_window_finder.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/wm_screen_util.h"
-#include "ash/common/wm_root_window_controller_observer.h"
+#include "ash/common/wm_shell.h"
#include "ash/mus/bridge/wm_root_window_controller_mus.h"
#include "ash/mus/bridge/wm_window_mus.h"
#include "ash/mus/bridge/wm_window_mus_test_api.h"
@@ -48,20 +49,16 @@ class MaximizeDelegateView : public views::WidgetDelegateView {
};
*/
-class FullscreenObserver : public WmRootWindowControllerObserver {
+class FullscreenObserver : public ShellObserver {
public:
- explicit FullscreenObserver(WmRootWindowController* root_window_controller)
- : root_window_controller_(root_window_controller),
- call_count_(0),
- is_fullscreen_(false) {
- root_window_controller_->AddObserver(this);
+ FullscreenObserver() : call_count_(0), is_fullscreen_(false) {
+ WmShell::Get()->AddShellObserver(this);
}
- ~FullscreenObserver() override {
- root_window_controller_->RemoveObserver(this);
- }
+ ~FullscreenObserver() override { WmShell::Get()->RemoveShellObserver(this); }
- void OnFullscreenStateChanged(bool is_fullscreen) override {
+ void OnFullscreenStateChanged(bool is_fullscreen,
+ WmWindow* root_window) override {
call_count_++;
is_fullscreen_ = is_fullscreen;
}
@@ -71,7 +68,6 @@ class FullscreenObserver : public WmRootWindowControllerObserver {
bool is_fullscreen() const { return is_fullscreen_; }
private:
- WmRootWindowController* root_window_controller_;
int call_count_;
bool is_fullscreen_;
@@ -456,8 +452,7 @@ TEST_F(WorkspaceLayoutManagerTest, SizeToWorkArea) {
}
TEST_F(WorkspaceLayoutManagerTest, NotifyFullscreenChanges) {
- FullscreenObserver observer(
- WmWindowMus::Get(GetPrimaryRootWindow())->GetRootWindowController());
+ FullscreenObserver observer;
ui::Window* window1 = CreateTestWindow(gfx::Rect(1, 2, 30, 40));
ui::Window* window2 = CreateTestWindow(gfx::Rect(1, 2, 30, 40));
wm::WindowState* window_state1 = WmWindowMus::Get(window1)->GetWindowState();
« no previous file with comments | « ash/mus/root_window_controller.cc ('k') | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698