| Index: ash/shell/launcher_item_delegate_impl.cc
|
| diff --git a/ash/shell/launcher_item_delegate_impl.cc b/ash/shell/launcher_item_delegate_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..61be3d6676b5609abd129a8db3b6fe332421ac99
|
| --- /dev/null
|
| +++ b/ash/shell/launcher_item_delegate_impl.cc
|
| @@ -0,0 +1,56 @@
|
| +// 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/shell/launcher_item_delegate_impl.h"
|
| +
|
| +#include "ash/shell/window_watcher.h"
|
| +#include "ash/wm/window_util.h"
|
| +#include "ui/aura/window.h"
|
| +
|
| +namespace ash {
|
| +namespace shell {
|
| +
|
| +LauncherItemDelegateImpl::LauncherItemDelegateImpl(
|
| + ash::LauncherID id,
|
| + ash::shell::WindowWatcher* watcher)
|
| + : id_(id),
|
| + watcher_(watcher) {
|
| + DCHECK(watcher_);
|
| +}
|
| +
|
| +LauncherItemDelegateImpl::~LauncherItemDelegateImpl() {
|
| +}
|
| +
|
| +void LauncherItemDelegateImpl::ItemSelected(const ui::Event& event) {
|
| + aura::Window* window = watcher_->GetWindowByID(id_);
|
| + if (window->type() == aura::client::WINDOW_TYPE_PANEL)
|
| + ash::wm::MoveWindowToEventRoot(window, event);
|
| + window->Show();
|
| + ash::wm::ActivateWindow(window);
|
| +}
|
| +
|
| +base::string16 LauncherItemDelegateImpl::GetTitle() {
|
| + return watcher_->GetWindowByID(id_)->title();
|
| +}
|
| +
|
| +ui::MenuModel* LauncherItemDelegateImpl::CreateContextMenu(
|
| + aura::RootWindow* root_window) {
|
| + return NULL;
|
| +}
|
| +
|
| +ash::LauncherMenuModel* LauncherItemDelegateImpl::CreateApplicationMenu(
|
| + int event_flags) {
|
| + return NULL;
|
| +}
|
| +
|
| +bool LauncherItemDelegateImpl::IsDraggable() {
|
| + return true;
|
| +}
|
| +
|
| +bool LauncherItemDelegateImpl::ShouldShowTooltip() {
|
| + return true;
|
| +}
|
| +
|
| +} // namespace shell
|
| +} // namespace ash
|
|
|