| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shelf/shelf_window_watcher_item_delegate.h" | 5 #include "ash/shelf/shelf_window_watcher_item_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_model.h" | 7 #include "ash/shelf/shelf_model.h" |
| 8 #include "ash/shelf/shelf_util.h" | 8 #include "ash/shelf/shelf_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 base::string16 ShelfWindowWatcherItemDelegate::GetTitle() { | 48 base::string16 ShelfWindowWatcherItemDelegate::GetTitle() { |
| 49 return GetShelfItemDetailsForWindow(window_)->title; | 49 return GetShelfItemDetailsForWindow(window_)->title; |
| 50 } | 50 } |
| 51 | 51 |
| 52 ui::MenuModel* ShelfWindowWatcherItemDelegate::CreateContextMenu( | 52 ui::MenuModel* ShelfWindowWatcherItemDelegate::CreateContextMenu( |
| 53 aura::Window* root_window) { | 53 aura::Window* root_window) { |
| 54 ash::LauncherItem item = | 54 ash::ShelfItem item = *(model_->ItemByID(GetShelfIDForWindow(window_))); |
| 55 *(model_->ItemByID(GetLauncherIDForWindow(window_))); | |
| 56 return Shell::GetInstance()->delegate()->CreateContextMenu(root_window, | 55 return Shell::GetInstance()->delegate()->CreateContextMenu(root_window, |
| 57 this, | 56 this, |
| 58 &item); | 57 &item); |
| 59 } | 58 } |
| 60 | 59 |
| 61 ShelfMenuModel* ShelfWindowWatcherItemDelegate::CreateApplicationMenu( | 60 ShelfMenuModel* ShelfWindowWatcherItemDelegate::CreateApplicationMenu( |
| 62 int event_flags) { | 61 int event_flags) { |
| 63 return NULL; | 62 return NULL; |
| 64 } | 63 } |
| 65 | 64 |
| 66 bool ShelfWindowWatcherItemDelegate::IsDraggable() { | 65 bool ShelfWindowWatcherItemDelegate::IsDraggable() { |
| 67 return true; | 66 return true; |
| 68 } | 67 } |
| 69 | 68 |
| 70 bool ShelfWindowWatcherItemDelegate::ShouldShowTooltip() { | 69 bool ShelfWindowWatcherItemDelegate::ShouldShowTooltip() { |
| 71 return true; | 70 return true; |
| 72 } | 71 } |
| 73 | 72 |
| 74 } // namespace internal | 73 } // namespace internal |
| 75 } // namespace ash | 74 } // namespace ash |
| OLD | NEW |