OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "ash/test/test_launcher_item_delegate.h" | |
6 | |
7 #include "ash/wm/window_util.h" | |
8 #include "ui/aura/window.h" | |
9 | |
10 namespace ash { | |
11 namespace test { | |
12 | |
13 TestLauncherItemDelegate::TestLauncherItemDelegate(aura::Window* window) | |
14 : window_(window) { | |
15 } | |
16 | |
17 TestLauncherItemDelegate::~TestLauncherItemDelegate() { | |
18 } | |
19 | |
20 void TestLauncherItemDelegate::ItemSelected(const ui::Event& event) { | |
21 if (window_) { | |
22 if (window_->type() == aura::client::WINDOW_TYPE_PANEL) | |
23 ash::wm::MoveWindowToEventRoot(window_, event); | |
24 window_->Show(); | |
25 ash::wm::ActivateWindow(window_); | |
26 } | |
27 } | |
28 | |
29 base::string16 TestLauncherItemDelegate::GetTitle() { | |
30 return window_ ? window_->title() : base::string16(); | |
31 } | |
32 | |
33 ui::MenuModel* TestLauncherItemDelegate::CreateContextMenu( | |
34 aura::RootWindow* root_window) { | |
35 return NULL; | |
36 } | |
37 | |
38 ash::LauncherMenuModel* TestLauncherItemDelegate::CreateApplicationMenu( | |
39 int event_flags) { | |
40 return NULL; | |
41 } | |
42 | |
43 bool TestLauncherItemDelegate::IsDraggable() { | |
44 return true; | |
45 } | |
46 | |
47 bool TestLauncherItemDelegate::ShouldShowTooltip() { | |
48 return true; | |
49 } | |
50 | |
51 } // namespace test | |
52 } // namespace ash | |
OLD | NEW |