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

Unified Diff: ash/common/shelf/shelf_window_watcher_item_delegate.cc

Issue 2357143004: mash: Support ShelfWindowWatcher via ShelfItem 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/common/shelf/shelf_window_watcher.cc ('k') | ash/common/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/common/shelf/shelf_window_watcher_item_delegate.cc
diff --git a/ash/common/shelf/shelf_window_watcher_item_delegate.cc b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
index 91a12e39e5310e894cdc5075d54e2356e28de99f..a1450e171d42059cb1f0af117e2f9180ea446c36 100644
--- a/ash/common/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
@@ -4,8 +4,6 @@
#include "ash/common/shelf/shelf_window_watcher_item_delegate.h"
-#include "ash/common/shelf/shelf_item_types.h"
-#include "ash/common/wm/window_state.h"
#include "ash/common/wm_window.h"
#include "ui/events/event.h"
@@ -18,23 +16,20 @@ ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {}
ShelfItemDelegate::PerformedAction ShelfWindowWatcherItemDelegate::ItemSelected(
const ui::Event& event) {
- wm::WindowState* window_state = window_->GetWindowState();
- if (window_state->IsActive()) {
+ if (window_->IsActive()) {
if (event.type() & ui::ET_KEY_RELEASED) {
window_->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
return kNoAction;
- } else {
- window_state->Minimize();
- return kExistingWindowMinimized;
}
- } else {
- window_state->Activate();
- return kExistingWindowActivated;
+ window_->Minimize();
+ return kExistingWindowMinimized;
}
+ window_->Activate();
+ return kExistingWindowActivated;
}
base::string16 ShelfWindowWatcherItemDelegate::GetTitle() {
- return window_->GetShelfItemDetails()->title;
+ return window_->GetTitle();
}
ShelfMenuModel* ShelfWindowWatcherItemDelegate::CreateApplicationMenu(
« no previous file with comments | « ash/common/shelf/shelf_window_watcher.cc ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698