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_shelf_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 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window* window) | 13 TestShelfItemDelegate::TestShelfItemDelegate(aura::Window* window) |
14 : window_(window) { | 14 : window_(window) { |
15 } | 15 } |
16 | 16 |
17 TestShelfItemDelegate::~TestShelfItemDelegate() { | 17 TestShelfItemDelegate::~TestShelfItemDelegate() { |
18 } | 18 } |
19 | 19 |
20 bool TestShelfItemDelegate::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() == ui::wm::WINDOW_TYPE_PANEL) |
23 wm::MoveWindowToEventRoot(window_, event); | 23 wm::MoveWindowToEventRoot(window_, event); |
24 window_->Show(); | 24 window_->Show(); |
25 wm::ActivateWindow(window_); | 25 wm::ActivateWindow(window_); |
26 } | 26 } |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 base::string16 TestShelfItemDelegate::GetTitle() { | 30 base::string16 TestShelfItemDelegate::GetTitle() { |
31 return window_ ? window_->title() : base::string16(); | 31 return window_ ? window_->title() : base::string16(); |
32 } | 32 } |
(...skipping 10 matching lines...) Expand all Loading... |
43 bool TestShelfItemDelegate::IsDraggable() { | 43 bool TestShelfItemDelegate::IsDraggable() { |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 bool TestShelfItemDelegate::ShouldShowTooltip() { | 47 bool TestShelfItemDelegate::ShouldShowTooltip() { |
48 return true; | 48 return true; |
49 } | 49 } |
50 | 50 |
51 } // namespace test | 51 } // namespace test |
52 } // namespace ash | 52 } // namespace ash |
OLD | NEW |