| Index: ash/test/test_launcher_item_delegate.cc
|
| diff --git a/ash/test/test_launcher_item_delegate.cc b/ash/test/test_launcher_item_delegate.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9cb56bb95408abda01de2fb12e580ba3037e03cf
|
| --- /dev/null
|
| +++ b/ash/test/test_launcher_item_delegate.cc
|
| @@ -0,0 +1,52 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/test/test_launcher_item_delegate.h"
|
| +
|
| +#include "ash/wm/window_util.h"
|
| +#include "ui/aura/window.h"
|
| +
|
| +namespace ash {
|
| +namespace test {
|
| +
|
| +TestLauncherItemDelegate::TestLauncherItemDelegate(aura::Window* window)
|
| + : window_(window) {
|
| +}
|
| +
|
| +TestLauncherItemDelegate::~TestLauncherItemDelegate() {
|
| +}
|
| +
|
| +void TestLauncherItemDelegate::ItemSelected(const ui::Event& event) {
|
| + if (window_) {
|
| + if (window_->type() == aura::client::WINDOW_TYPE_PANEL)
|
| + ash::wm::MoveWindowToEventRoot(window_, event);
|
| + window_->Show();
|
| + ash::wm::ActivateWindow(window_);
|
| + }
|
| +}
|
| +
|
| +base::string16 TestLauncherItemDelegate::GetTitle() {
|
| + return window_ ? window_->title() : base::string16();
|
| +}
|
| +
|
| +ui::MenuModel* TestLauncherItemDelegate::CreateContextMenu(
|
| + aura::RootWindow* root_window) {
|
| + return NULL;
|
| +}
|
| +
|
| +ash::LauncherMenuModel* TestLauncherItemDelegate::CreateApplicationMenu(
|
| + int event_flags) {
|
| + return NULL;
|
| +}
|
| +
|
| +bool TestLauncherItemDelegate::IsDraggable() {
|
| + return true;
|
| +}
|
| +
|
| +bool TestLauncherItemDelegate::ShouldShowTooltip() {
|
| + return true;
|
| +}
|
| +
|
| +} // namespace test
|
| +} // namespace ash
|
|
|