• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_shelf_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 
TestShelfItemDelegate(aura::Window * window)13 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window* window)
14     : window_(window) {
15 }
16 
~TestShelfItemDelegate()17 TestShelfItemDelegate::~TestShelfItemDelegate() {
18 }
19 
ItemSelected(const ui::Event & event)20 bool TestShelfItemDelegate::ItemSelected(const ui::Event& event) {
21   if (window_) {
22     if (window_->type() == ui::wm::WINDOW_TYPE_PANEL)
23       wm::MoveWindowToEventRoot(window_, event);
24     window_->Show();
25     wm::ActivateWindow(window_);
26   }
27   return false;
28 }
29 
GetTitle()30 base::string16 TestShelfItemDelegate::GetTitle() {
31   return window_ ? window_->title() : base::string16();
32 }
33 
CreateContextMenu(aura::Window * root_window)34 ui::MenuModel* TestShelfItemDelegate::CreateContextMenu(
35     aura::Window* root_window) {
36   return NULL;
37 }
38 
CreateApplicationMenu(int event_flags)39 ShelfMenuModel* TestShelfItemDelegate::CreateApplicationMenu(int event_flags) {
40   return NULL;
41 }
42 
IsDraggable()43 bool TestShelfItemDelegate::IsDraggable() {
44   return true;
45 }
46 
ShouldShowTooltip()47 bool TestShelfItemDelegate::ShouldShowTooltip() {
48   return true;
49 }
50 
Close()51 void TestShelfItemDelegate::Close() {
52 }
53 
54 }  // namespace test
55 }  // namespace ash
56