Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: ash/common/test/test_shelf_item_delegate.cc

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: nit Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/test/test_shelf_item_delegate.h ('k') | ash/public/cpp/shelf_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « ash/common/test/test_shelf_item_delegate.h ('k') | ash/public/cpp/shelf_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698