SimpleCache: add an histogram to record the age of entry on open
[chromium-blink-merge.git] / ash / shell / launcher_delegate_impl.cc
blob51f6171f8c95c87a0f1a9f5de68846dae14111b8
1 // Copyright (c) 2012 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/shell/launcher_delegate_impl.h"
7 #include "ash/launcher/launcher_util.h"
8 #include "ash/shell/toplevel_window.h"
9 #include "ash/shell/window_watcher.h"
10 #include "ash/wm/window_util.h"
11 #include "grit/ash_resources.h"
12 #include "ui/aura/window.h"
14 namespace ash {
15 namespace shell {
17 LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher)
18 : watcher_(watcher) {
21 LauncherDelegateImpl::~LauncherDelegateImpl() {
24 void LauncherDelegateImpl::ItemSelected(const ash::LauncherItem& item,
25 const ui::Event& event) {
26 aura::Window* window = watcher_->GetWindowByID(item.id);
27 if (window->type() == aura::client::WINDOW_TYPE_PANEL)
28 ash::wm::MoveWindowToEventRoot(window, event);
29 window->Show();
30 ash::wm::ActivateWindow(window);
33 base::string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
34 return watcher_->GetWindowByID(item.id)->title();
37 ui::MenuModel* LauncherDelegateImpl::CreateContextMenu(
38 const ash::LauncherItem& item,
39 aura::RootWindow* root_window) {
40 return NULL;
43 ash::LauncherMenuModel* LauncherDelegateImpl::CreateApplicationMenu(
44 const ash::LauncherItem& item,
45 int event_flags) {
46 return NULL;
49 ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) {
50 return watcher_ ? watcher_->GetIDByWindow(window) : 0;
53 bool LauncherDelegateImpl::IsDraggable(const ash::LauncherItem& item) {
54 return true;
57 bool LauncherDelegateImpl::ShouldShowTooltip(const ash::LauncherItem& item) {
58 return true;
61 void LauncherDelegateImpl::OnLauncherCreated(Launcher* launcher) {
64 void LauncherDelegateImpl::OnLauncherDestroyed(Launcher* launcher) {
67 bool LauncherDelegateImpl::IsPerAppLauncher() {
68 return false;
71 LauncherID LauncherDelegateImpl::GetLauncherIDForAppID(
72 const std::string& app_id) {
73 return 0;
76 void LauncherDelegateImpl::PinAppWithID(const std::string& app_id) {
79 bool LauncherDelegateImpl::IsAppPinned(const std::string& app_id) {
80 return false;
83 void LauncherDelegateImpl::UnpinAppsWithID(const std::string& app_id) {
86 } // namespace shell
87 } // namespace ash