| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/test/test_launcher_item_delegate.h" | 5 #include "ash/test/test_shelf_item_delegate.h" |
| 6 | 6 |
| 7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 | 9 |
| 10 namespace ash { | 10 namespace ash { |
| 11 namespace test { | 11 namespace test { |
| 12 | 12 |
| 13 TestLauncherItemDelegate::TestLauncherItemDelegate(aura::Window* window) | 13 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window* window) |
| 14 : window_(window) { | 14 : window_(window) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 TestLauncherItemDelegate::~TestLauncherItemDelegate() { | 17 TestShelfItemDelegate::~TestShelfItemDelegate() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 bool TestLauncherItemDelegate::ItemSelected(const ui::Event& event) { | 20 bool TestShelfItemDelegate::ItemSelected(const ui::Event& event) { |
| 21 if (window_) { | 21 if (window_) { |
| 22 if (window_->type() == aura::client::WINDOW_TYPE_PANEL) | 22 if (window_->type() == aura::client::WINDOW_TYPE_PANEL) |
| 23 ash::wm::MoveWindowToEventRoot(window_, event); | 23 wm::MoveWindowToEventRoot(window_, event); |
| 24 window_->Show(); | 24 window_->Show(); |
| 25 ash::wm::ActivateWindow(window_); | 25 wm::ActivateWindow(window_); |
| 26 } | 26 } |
| 27 return false; | 27 return false; |
| 28 } | 28 } |
| 29 | 29 |
| 30 base::string16 TestLauncherItemDelegate::GetTitle() { | 30 base::string16 TestShelfItemDelegate::GetTitle() { |
| 31 return window_ ? window_->title() : base::string16(); | 31 return window_ ? window_->title() : base::string16(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ui::MenuModel* TestLauncherItemDelegate::CreateContextMenu( | 34 ui::MenuModel* TestShelfItemDelegate::CreateContextMenu( |
| 35 aura::Window* root_window) { | 35 aura::Window* root_window) { |
| 36 return NULL; | 36 return NULL; |
| 37 } | 37 } |
| 38 | 38 |
| 39 ash::LauncherMenuModel* TestLauncherItemDelegate::CreateApplicationMenu( | 39 LauncherMenuModel* TestShelfItemDelegate::CreateApplicationMenu( |
| 40 int event_flags) { | 40 int event_flags) { |
| 41 return NULL; | 41 return NULL; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool TestLauncherItemDelegate::IsDraggable() { | 44 bool TestShelfItemDelegate::IsDraggable() { |
| 45 return true; | 45 return true; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool TestLauncherItemDelegate::ShouldShowTooltip() { | 48 bool TestShelfItemDelegate::ShouldShowTooltip() { |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace test | 52 } // namespace test |
| 53 } // namespace ash | 53 } // namespace ash |
| OLD | NEW |