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
3 // found in the LICENSE file.
5 #include "ash/test/test_shelf_item_delegate.h"
7 #include "ash/wm/window_util.h"
8 #include "ui/aura/window.h"
13 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window
* window
)
17 TestShelfItemDelegate::~TestShelfItemDelegate() {
20 bool TestShelfItemDelegate::ItemSelected(const ui::Event
& event
) {
22 if (window_
->type() == ui::wm::WINDOW_TYPE_PANEL
)
23 wm::MoveWindowToEventRoot(window_
, event
);
25 wm::ActivateWindow(window_
);
30 base::string16
TestShelfItemDelegate::GetTitle() {
31 return window_
? window_
->title() : base::string16();
34 ui::MenuModel
* TestShelfItemDelegate::CreateContextMenu(
35 aura::Window
* root_window
) {
39 ShelfMenuModel
* TestShelfItemDelegate::CreateApplicationMenu(int event_flags
) {
43 bool TestShelfItemDelegate::IsDraggable() {
47 bool TestShelfItemDelegate::ShouldShowTooltip() {