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

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

Issue 1851883002: Cleanup shelf initialization and observation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for shelf before setting prefs in ChromeLauncherController. Created 4 years, 8 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
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/test/test_shelf_delegate.h" 5 #include "ash/test/test_shelf_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/shelf/shelf_item_delegate_manager.h" 9 #include "ash/shelf/shelf_item_delegate_manager.h"
10 #include "ash/shelf/shelf_model.h" 10 #include "ash/shelf/shelf_model.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 void TestShelfDelegate::OnWindowHierarchyChanging( 84 void TestShelfDelegate::OnWindowHierarchyChanging(
85 const HierarchyChangeParams& params) { 85 const HierarchyChangeParams& params) {
86 // The window may be legitimately reparented while staying open if it moves 86 // The window may be legitimately reparented while staying open if it moves
87 // to another display or container. If the window does not have a new parent 87 // to another display or container. If the window does not have a new parent
88 // then remove the shelf item. 88 // then remove the shelf item.
89 if (!params.new_parent) 89 if (!params.new_parent)
90 RemoveShelfItemForWindow(params.target); 90 RemoveShelfItemForWindow(params.target);
91 } 91 }
92 92
93 void TestShelfDelegate::OnShelfCreated(Shelf* shelf) { 93 void TestShelfDelegate::OnShelfCreated(Shelf* shelf) {}
94 }
95 94
96 void TestShelfDelegate::OnShelfDestroyed(Shelf* shelf) { 95 void TestShelfDelegate::OnShelfDestroyed(Shelf* shelf) {}
97 } 96
97 void TestShelfDelegate::OnShelfAlignmentChanged(Shelf* shelf) {}
98
99 void TestShelfDelegate::OnShelfAutoHideBehaviorChanged(Shelf* shelf) {}
98 100
99 ShelfID TestShelfDelegate::GetShelfIDForAppID(const std::string& app_id) { 101 ShelfID TestShelfDelegate::GetShelfIDForAppID(const std::string& app_id) {
100 for (auto const& iter : shelf_id_to_app_id_map_) { 102 for (auto const& iter : shelf_id_to_app_id_map_) {
101 if (iter.second == app_id) 103 if (iter.second == app_id)
102 return iter.first; 104 return iter.first;
103 } 105 }
104 return 0; 106 return 0;
105 } 107 }
106 108
107 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const { 109 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const {
(...skipping 21 matching lines...) Expand all
129 const std::string& app_id) { 131 const std::string& app_id) {
130 shelf_id_to_app_id_map_[shelf_id] = app_id; 132 shelf_id_to_app_id_map_[shelf_id] = app_id;
131 } 133 }
132 134
133 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { 135 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) {
134 shelf_id_to_app_id_map_.erase(shelf_id); 136 shelf_id_to_app_id_map_.erase(shelf_id);
135 } 137 }
136 138
137 } // namespace test 139 } // namespace test
138 } // namespace ash 140 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698