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

Unified Diff: ash/shelf/shelf_window_watcher_item_delegate.cc

Issue 107163005: [ash] Add TYPE_DIALOG and its item's LauncherContextMenu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 11 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/shell/shell_delegate_impl.h » ('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 6c7cc6565dcfda44f1298be9f9b0614ddaaed7b0..53fd1008088bf08cb06b264ec678198130dec13e 100644
--- a/ash/shelf/shelf_window_watcher_item_delegate.cc
+++ b/ash/shelf/shelf_window_watcher_item_delegate.cc
@@ -4,7 +4,10 @@
#include "ash/shelf/shelf_window_watcher_item_delegate.h"
+#include "ash/shelf/shelf_model.h"
#include "ash/shelf/shelf_util.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/window_state.h"
#include "ui/aura/window.h"
#include "ui/views/corewm/window_animations.h"
@@ -14,8 +17,9 @@ namespace ash {
namespace internal {
ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(
- aura::Window* window)
- : window_(window) {
+ aura::Window* window, ShelfModel* model)
+ : window_(window),
+ model_(model) {
}
ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {
@@ -47,8 +51,11 @@ base::string16 ShelfWindowWatcherItemDelegate::GetTitle() {
ui::MenuModel* ShelfWindowWatcherItemDelegate::CreateContextMenu(
aura::Window* root_window) {
- // TODO(simonhong): Create ShelfItemContextMenu.
- return NULL;
+ ash::LauncherItem item =
+ *(model_->ItemByID(GetLauncherIDForWindow(window_)));
+ return Shell::GetInstance()->delegate()->CreateContextMenu(root_window,
+ this,
+ &item);
}
ShelfMenuModel* ShelfWindowWatcherItemDelegate::CreateApplicationMenu(
« no previous file with comments | « ash/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/shell/shell_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698