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

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

Issue 2627533002: Replace ShelfItemDelegate::GetTitle() with ShelfItem::title. (Closed)
Patch Set: Address comments. Created 3 years, 11 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/shell/window_watcher.cc » ('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 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
OLDNEW
« no previous file with comments | « ash/common/test/test_shelf_item_delegate.h ('k') | ash/shell/window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698