| 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_delegate.h" | 5 #include "ash/test/test_shelf_delegate.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const { | 106 bool TestShelfDelegate::HasShelfIDToAppIDMapping(ShelfID id) const { |
| 107 return shelf_id_to_app_id_map_.find(id) != shelf_id_to_app_id_map_.end(); | 107 return shelf_id_to_app_id_map_.find(id) != shelf_id_to_app_id_map_.end(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 const std::string& TestShelfDelegate::GetAppIDForShelfID(ShelfID id) { | 110 const std::string& TestShelfDelegate::GetAppIDForShelfID(ShelfID id) { |
| 111 DCHECK_GT(shelf_id_to_app_id_map_.count(id), 0u); | 111 DCHECK_GT(shelf_id_to_app_id_map_.count(id), 0u); |
| 112 return shelf_id_to_app_id_map_[id]; | 112 return shelf_id_to_app_id_map_[id]; |
| 113 } | 113 } |
| 114 | 114 |
| 115 const std::string& TestShelfDelegate::GetLaunchIDForShelfID(ShelfID id) { |
| 116 DCHECK_GT(shelf_id_to_app_id_map_.count(id), 0u); |
| 117 return base::EmptyString(); |
| 118 } |
| 119 |
| 115 void TestShelfDelegate::PinAppWithID(const std::string& app_id) { | 120 void TestShelfDelegate::PinAppWithID(const std::string& app_id) { |
| 116 pinned_apps_.insert(app_id); | 121 pinned_apps_.insert(app_id); |
| 117 } | 122 } |
| 118 | 123 |
| 119 bool TestShelfDelegate::IsAppPinned(const std::string& app_id) { | 124 bool TestShelfDelegate::IsAppPinned(const std::string& app_id) { |
| 120 return pinned_apps_.find(app_id) != pinned_apps_.end(); | 125 return pinned_apps_.find(app_id) != pinned_apps_.end(); |
| 121 } | 126 } |
| 122 | 127 |
| 123 void TestShelfDelegate::UnpinAppWithID(const std::string& app_id) { | 128 void TestShelfDelegate::UnpinAppWithID(const std::string& app_id) { |
| 124 pinned_apps_.erase(app_id); | 129 pinned_apps_.erase(app_id); |
| 125 } | 130 } |
| 126 | 131 |
| 127 void TestShelfDelegate::AddShelfIDToAppIDMapping(ShelfID shelf_id, | 132 void TestShelfDelegate::AddShelfIDToAppIDMapping(ShelfID shelf_id, |
| 128 const std::string& app_id) { | 133 const std::string& app_id) { |
| 129 shelf_id_to_app_id_map_[shelf_id] = app_id; | 134 shelf_id_to_app_id_map_[shelf_id] = app_id; |
| 130 } | 135 } |
| 131 | 136 |
| 132 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { | 137 void TestShelfDelegate::RemoveShelfIDToAppIDMapping(ShelfID shelf_id) { |
| 133 shelf_id_to_app_id_map_.erase(shelf_id); | 138 shelf_id_to_app_id_map_.erase(shelf_id); |
| 134 } | 139 } |
| 135 | 140 |
| 136 } // namespace test | 141 } // namespace test |
| 137 } // namespace ash | 142 } // namespace ash |
| OLD | NEW |