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 | 8 |
9 namespace ash { | 9 namespace ash { |
10 namespace test { | 10 namespace test { |
11 | 11 |
12 TestShelfItemDelegate::TestShelfItemDelegate(WmWindow* window) | 12 TestShelfItemDelegate::TestShelfItemDelegate(WmWindow* window) |
13 : window_(window) {} | 13 : window_(window) {} |
14 | 14 |
15 TestShelfItemDelegate::~TestShelfItemDelegate() {} | 15 TestShelfItemDelegate::~TestShelfItemDelegate() {} |
16 | 16 |
17 ShelfItemDelegate::PerformedAction TestShelfItemDelegate::ItemSelected( | 17 ShelfItemDelegate::PerformedAction TestShelfItemDelegate::ItemSelected( |
18 const ui::Event& event) { | 18 const ui::Event& event) { |
19 if (window_) { | 19 if (window_) { |
20 if (window_->GetType() == ui::wm::WINDOW_TYPE_PANEL) | 20 if (window_->GetType() == ui::wm::WINDOW_TYPE_PANEL) |
21 window_->MoveToEventRoot(event); | 21 window_->MoveToEventRoot(event); |
22 window_->Show(); | 22 window_->Show(); |
23 window_->Activate(); | 23 window_->Activate(); |
24 return kExistingWindowActivated; | 24 return kExistingWindowActivated; |
25 } | 25 } |
26 return kNoAction; | 26 return kNoAction; |
27 } | 27 } |
28 | 28 |
29 base::string16 TestShelfItemDelegate::GetTitle() { | |
30 return window_ ? window_->GetTitle() : base::string16(); | |
31 } | |
32 | |
33 ShelfMenuModel* TestShelfItemDelegate::CreateApplicationMenu(int event_flags) { | 29 ShelfMenuModel* TestShelfItemDelegate::CreateApplicationMenu(int event_flags) { |
34 return nullptr; | 30 return nullptr; |
35 } | 31 } |
36 | 32 |
37 void TestShelfItemDelegate::Close() {} | 33 void TestShelfItemDelegate::Close() {} |
38 | 34 |
39 } // namespace test | 35 } // namespace test |
40 } // namespace ash | 36 } // namespace ash |
OLD | NEW |