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

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

Issue 2518423003: Combine shelf platform and windowed app types. (Closed)
Patch Set: Update platform-app test support; address comment; format. Created 4 years 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
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_delegate.h" 5 #include "ash/common/test/test_shelf_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_model.h" 9 #include "ash/common/shelf/shelf_model.h"
10 #include "ash/common/test/test_shelf_item_delegate.h" 10 #include "ash/common/test/test_shelf_item_delegate.h"
(...skipping 24 matching lines...) Expand all
35 AddShelfItem(window, STATUS_CLOSED); 35 AddShelfItem(window, STATUS_CLOSED);
36 ShelfID shelf_id = window->GetIntProperty(WmWindowProperty::SHELF_ID); 36 ShelfID shelf_id = window->GetIntProperty(WmWindowProperty::SHELF_ID);
37 AddShelfIDToAppIDMapping(shelf_id, app_id); 37 AddShelfIDToAppIDMapping(shelf_id, app_id);
38 } 38 }
39 39
40 void TestShelfDelegate::AddShelfItem(WmWindow* window, ShelfItemStatus status) { 40 void TestShelfDelegate::AddShelfItem(WmWindow* window, ShelfItemStatus status) {
41 ShelfItem item; 41 ShelfItem item;
42 if (window->GetType() == ui::wm::WINDOW_TYPE_PANEL) 42 if (window->GetType() == ui::wm::WINDOW_TYPE_PANEL)
43 item.type = TYPE_APP_PANEL; 43 item.type = TYPE_APP_PANEL;
44 else 44 else
45 item.type = TYPE_PLATFORM_APP; 45 item.type = TYPE_APP;
46 ShelfID id = model_->next_id(); 46 ShelfID id = model_->next_id();
47 item.status = status; 47 item.status = status;
48 model_->Add(item); 48 model_->Add(item);
49 window->AddObserver(this); 49 window->AddObserver(this);
50 50
51 model_->SetShelfItemDelegate(id, 51 model_->SetShelfItemDelegate(id,
52 base::MakeUnique<TestShelfItemDelegate>(window)); 52 base::MakeUnique<TestShelfItemDelegate>(window));
53 window->SetIntProperty(WmWindowProperty::SHELF_ID, id); 53 window->SetIntProperty(WmWindowProperty::SHELF_ID, id);
54 } 54 }
55 55
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const std::string& app_id) { 122 const std::string& app_id) {
123 shelf_id_to_app_id_map_[shelf_id] = app_id; 123 shelf_id_to_app_id_map_[shelf_id] = app_id;
124 } 124 }
125 125
126 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { 126 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) {
127 shelf_id_to_app_id_map_.erase(shelf_id); 127 shelf_id_to_app_id_map_.erase(shelf_id);
128 } 128 }
129 129
130 } // namespace test 130 } // namespace test
131 } // namespace ash 131 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698