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

Unified Diff: ash/shelf/shelf_window_watcher_item_delegate.cc

Issue 2192553002: mash: Convert ShelfWindowWatcher to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits and better test Created 4 years, 5 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/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_window_watcher_item_delegate.cc
diff --git a/ash/shelf/shelf_window_watcher_item_delegate.cc b/ash/shelf/shelf_window_watcher_item_delegate.cc
index fb166bd05e738f5426c3de38ef58a3f6168d0e89..b40783323cc863d5c9867ef72733bbbd7a4ff4c7 100644
--- a/ash/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/shelf/shelf_window_watcher_item_delegate.cc
@@ -5,31 +5,24 @@
#include "ash/shelf/shelf_window_watcher_item_delegate.h"
#include "ash/common/wm/window_state.h"
+#include "ash/common/wm_window.h"
#include "ash/shelf/shelf_util.h"
-#include "ash/shell.h"
-#include "ash/wm/window_state_aura.h"
-#include "ui/aura/window.h"
-#include "ui/views/widget/widget.h"
+#include "ui/events/event.h"
#include "ui/wm/core/window_animations.h"
namespace ash {
-ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(
- aura::Window* window)
+ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(WmWindow* window)
: window_(window) {}
ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {}
-void ShelfWindowWatcherItemDelegate::Close() {
- views::Widget::GetWidgetForNativeWindow(window_)->Close();
-}
-
ShelfItemDelegate::PerformedAction ShelfWindowWatcherItemDelegate::ItemSelected(
const ui::Event& event) {
- wm::WindowState* window_state = wm::GetWindowState(window_);
+ wm::WindowState* window_state = window_->GetWindowState();
if (window_state->IsActive()) {
if (event.type() & ui::ET_KEY_RELEASED) {
- ::wm::AnimateWindow(window_, ::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
+ window_->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
return kNoAction;
} else {
window_state->Minimize();
@@ -42,7 +35,7 @@ ShelfItemDelegate::PerformedAction ShelfWindowWatcherItemDelegate::ItemSelected(
}
base::string16 ShelfWindowWatcherItemDelegate::GetTitle() {
- return GetShelfItemDetailsForWindow(window_)->title;
+ return window_->GetShelfItemDetails()->title;
}
ShelfMenuModel* ShelfWindowWatcherItemDelegate::CreateApplicationMenu(
@@ -62,4 +55,8 @@ bool ShelfWindowWatcherItemDelegate::ShouldShowTooltip() {
return true;
}
+void ShelfWindowWatcherItemDelegate::Close() {
+ window_->CloseWidget();
+}
+
} // namespace ash
« no previous file with comments | « ash/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698