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

Unified Diff: ash/common/test/test_shelf_delegate.cc

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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/test/test_shelf_delegate.h ('k') | ash/common/wallpaper/wallpaper_widget_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/test/test_shelf_delegate.cc
diff --git a/ash/common/test/test_shelf_delegate.cc b/ash/common/test/test_shelf_delegate.cc
index d0f21f0c51190495a36122f35fa2996416e8ba6b..24a1ad503cc4f3ee0c5e045f6d5861f3482082c6 100644
--- a/ash/common/test/test_shelf_delegate.cc
+++ b/ash/common/test/test_shelf_delegate.cc
@@ -15,6 +15,7 @@
#include "ash/common/wm_window_property.h"
#include "ash/root_window_controller.h"
#include "base/memory/ptr_util.h"
+#include "ui/aura/window.h"
namespace ash {
namespace test {
@@ -75,7 +76,7 @@ void TestShelfDelegate::AddShelfItem(WmWindow* window, ShelfItemStatus status) {
ShelfID id = model->next_id();
item.status = status;
model->Add(item);
- window->AddObserver(this);
+ window->aura_window()->AddObserver(this);
model->SetShelfItemDelegate(id,
base::MakeUnique<TestShelfItemDelegate>(window));
@@ -90,7 +91,7 @@ void TestShelfDelegate::RemoveShelfItemForWindow(WmWindow* window) {
int index = model->ItemIndexByID(shelf_id);
DCHECK_NE(-1, index);
model->RemoveItemAt(index);
- window->RemoveObserver(this);
+ window->aura_window()->RemoveObserver(this);
if (HasShelfIDToAppIDMapping(shelf_id)) {
const std::string& app_id = GetAppIDForShelfID(shelf_id);
if (IsAppPinned(app_id))
@@ -100,17 +101,17 @@ void TestShelfDelegate::RemoveShelfItemForWindow(WmWindow* window) {
}
}
-void TestShelfDelegate::OnWindowDestroying(WmWindow* window) {
- RemoveShelfItemForWindow(window);
+void TestShelfDelegate::OnWindowDestroying(aura::Window* window) {
+ RemoveShelfItemForWindow(WmWindow::Get(window));
}
-void TestShelfDelegate::OnWindowTreeChanging(WmWindow* window,
- const TreeChangeParams& params) {
+void TestShelfDelegate::OnWindowHierarchyChanging(
+ const HierarchyChangeParams& params) {
// The window may be legitimately reparented while staying open if it moves
// to another display or container. If the window does not have a new parent
// then remove the shelf item.
if (!params.new_parent)
- RemoveShelfItemForWindow(params.target);
+ RemoveShelfItemForWindow(WmWindow::Get(params.target));
}
ShelfID TestShelfDelegate::GetShelfIDForAppID(const std::string& app_id) {
« no previous file with comments | « ash/common/test/test_shelf_delegate.h ('k') | ash/common/wallpaper/wallpaper_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698