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

Unified Diff: ash/test/test_shelf_delegate.cc

Issue 2332393003: mash: Remove shelf util functions; use WmWindow properties. (Closed)
Patch Set: Address comments. Created 4 years, 3 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/shell/window_watcher.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/test_shelf_delegate.cc
diff --git a/ash/test/test_shelf_delegate.cc b/ash/test/test_shelf_delegate.cc
index 1e892e029c963f255f299edd34c1b78f7ea1f79f..c700ebf6a706b61c68eab916c928a453919b5ae9 100644
--- a/ash/test/test_shelf_delegate.cc
+++ b/ash/test/test_shelf_delegate.cc
@@ -6,8 +6,9 @@
#include <utility>
+#include "ash/aura/wm_window_aura.h"
#include "ash/common/shelf/shelf_model.h"
-#include "ash/shelf/shelf_util.h"
+#include "ash/common/wm_window_property.h"
#include "ash/test/test_shelf_item_delegate.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -34,7 +35,9 @@ void TestShelfDelegate::AddShelfItem(aura::Window* window) {
void TestShelfDelegate::AddShelfItem(aura::Window* window,
const std::string& app_id) {
AddShelfItem(window, STATUS_CLOSED);
- AddShelfIDToAppIDMapping(GetShelfIDForWindow(window), app_id);
+ WmWindow* wm_window = WmWindowAura::Get(window);
+ ShelfID shelf_id = wm_window->GetIntProperty(WmWindowProperty::SHELF_ID);
+ AddShelfIDToAppIDMapping(shelf_id, app_id);
}
void TestShelfDelegate::AddShelfItem(aura::Window* window,
@@ -52,11 +55,12 @@ void TestShelfDelegate::AddShelfItem(aura::Window* window,
std::unique_ptr<ShelfItemDelegate> delegate(
new TestShelfItemDelegate(window));
model_->SetShelfItemDelegate(id, std::move(delegate));
- SetShelfIDForWindow(id, window);
+ WmWindowAura::Get(window)->SetIntProperty(WmWindowProperty::SHELF_ID, id);
}
void TestShelfDelegate::RemoveShelfItemForWindow(aura::Window* window) {
- ShelfID shelf_id = GetShelfIDForWindow(window);
+ WmWindow* wm_window = WmWindowAura::Get(window);
+ ShelfID shelf_id = wm_window->GetIntProperty(WmWindowProperty::SHELF_ID);
if (shelf_id == 0)
return;
int index = model_->ItemIndexByID(shelf_id);
« no previous file with comments | « ash/shell/window_watcher.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698