Flatten media_router.js.
[chromium-blink-merge.git] / ash / test / test_shelf_item_delegate.cc
bloba70b45175c86a545eab57bf59c2238cd0fd39576
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"
10 namespace ash {
11 namespace test {
13 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window* window)
14 : window_(window) {
17 TestShelfItemDelegate::~TestShelfItemDelegate() {
20 ShelfItemDelegate::PerformedAction TestShelfItemDelegate::ItemSelected(
21 const ui::Event& event) {
22 if (window_) {
23 if (window_->type() == ui::wm::WINDOW_TYPE_PANEL)
24 wm::MoveWindowToEventRoot(window_, event);
25 window_->Show();
26 wm::ActivateWindow(window_);
27 return kExistingWindowActivated;
29 return kNoAction;
32 base::string16 TestShelfItemDelegate::GetTitle() {
33 return window_ ? window_->title() : base::string16();
36 ui::MenuModel* TestShelfItemDelegate::CreateContextMenu(
37 aura::Window* root_window) {
38 return NULL;
41 ShelfMenuModel* TestShelfItemDelegate::CreateApplicationMenu(int event_flags) {
42 return NULL;
45 bool TestShelfItemDelegate::IsDraggable() {
46 return true;
49 bool TestShelfItemDelegate::ShouldShowTooltip() {
50 return true;
53 void TestShelfItemDelegate::Close() {
56 } // namespace test
57 } // namespace ash