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/common/test/test_shelf_item_delegate.h" | 5 #include "ash/common/test/test_shelf_item_delegate.h" |
6 | 6 |
7 #include "ash/common/wm_window.h" | 7 #include "ash/common/wm_window.h" |
| 8 #include "ash/wm/window_util.h" |
8 | 9 |
9 namespace ash { | 10 namespace ash { |
10 namespace test { | 11 namespace test { |
11 | 12 |
12 TestShelfItemDelegate::TestShelfItemDelegate(WmWindow* window) | 13 TestShelfItemDelegate::TestShelfItemDelegate(WmWindow* window) |
13 : window_(window) {} | 14 : window_(window) {} |
14 | 15 |
15 TestShelfItemDelegate::~TestShelfItemDelegate() {} | 16 TestShelfItemDelegate::~TestShelfItemDelegate() {} |
16 | 17 |
17 ShelfItemDelegate::PerformedAction TestShelfItemDelegate::ItemSelected( | 18 ShelfAction TestShelfItemDelegate::ItemSelected(ui::EventType event_type, |
18 const ui::Event& event) { | 19 int event_flags, |
| 20 int64_t display_id, |
| 21 ShelfLaunchSource source) { |
19 if (window_) { | 22 if (window_) { |
20 if (window_->GetType() == ui::wm::WINDOW_TYPE_PANEL) | 23 if (window_->GetType() == ui::wm::WINDOW_TYPE_PANEL) |
21 window_->MoveToEventRoot(event); | 24 wm::MoveWindowToDisplay(window_->aura_window(), display_id); |
22 window_->Show(); | 25 window_->Show(); |
23 window_->Activate(); | 26 window_->Activate(); |
24 return kExistingWindowActivated; | 27 return SHELF_ACTION_WINDOW_ACTIVATED; |
25 } | 28 } |
26 return kNoAction; | 29 return SHELF_ACTION_NONE; |
27 } | 30 } |
28 | 31 |
29 ShelfAppMenuItemList TestShelfItemDelegate::GetAppMenuItems(int event_flags) { | 32 ShelfAppMenuItemList TestShelfItemDelegate::GetAppMenuItems(int event_flags) { |
30 // Return an empty item list to avoid showing an application menu. | 33 // Return an empty item list to avoid showing an application menu. |
31 return ShelfAppMenuItemList(); | 34 return ShelfAppMenuItemList(); |
32 } | 35 } |
33 | 36 |
34 void TestShelfItemDelegate::Close() {} | 37 void TestShelfItemDelegate::Close() {} |
35 | 38 |
36 } // namespace test | 39 } // namespace test |
37 } // namespace ash | 40 } // namespace ash |
OLD | NEW |