| 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 #ifndef ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ | 5 #ifndef ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ |
| 6 #define ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ | 6 #define ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "ash/common/shelf/shelf_delegate.h" | 12 #include "ash/common/shelf/shelf_delegate.h" |
| 13 #include "ash/common/wm_window_observer.h" | 13 #include "ash/common/wm_window_observer.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 class ShelfModel; | 18 class ShelfModel; |
| 19 | 19 |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 class ShelfInitializer; |
| 23 |
| 22 // Test implementation of ShelfDelegate. | 24 // Test implementation of ShelfDelegate. |
| 23 // Tests may create icons for windows by calling AddShelfItem(). | 25 // Tests may create icons for windows by calling AddShelfItem(). |
| 24 class TestShelfDelegate : public ShelfDelegate, public WmWindowObserver { | 26 class TestShelfDelegate : public ShelfDelegate, public WmWindowObserver { |
| 25 public: | 27 public: |
| 26 explicit TestShelfDelegate(ShelfModel* model); | 28 explicit TestShelfDelegate(ShelfModel* model); |
| 27 ~TestShelfDelegate() override; | 29 ~TestShelfDelegate() override; |
| 28 | 30 |
| 29 // Adds a ShelfItem for the given |window|. The ShelfItem's status will be | 31 // Adds a ShelfItem for the given |window|. The ShelfItem's status will be |
| 30 // STATUS_CLOSED. | 32 // STATUS_CLOSED. |
| 31 void AddShelfItem(WmWindow* window); | 33 void AddShelfItem(WmWindow* window); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 | 64 |
| 63 private: | 65 private: |
| 64 // Adds a mapping from a ShelfID to an app id. | 66 // Adds a mapping from a ShelfID to an app id. |
| 65 void AddShelfIDToAppIDMapping(ShelfID shelf_id, const std::string& app_id); | 67 void AddShelfIDToAppIDMapping(ShelfID shelf_id, const std::string& app_id); |
| 66 | 68 |
| 67 // Removes the mapping from a ShelfID to an app id. | 69 // Removes the mapping from a ShelfID to an app id. |
| 68 void RemoveShelfIDToAppIDMapping(ShelfID shelf_id); | 70 void RemoveShelfIDToAppIDMapping(ShelfID shelf_id); |
| 69 | 71 |
| 70 static TestShelfDelegate* instance_; | 72 static TestShelfDelegate* instance_; |
| 71 | 73 |
| 74 std::unique_ptr<ShelfInitializer> shelf_initializer_; |
| 75 |
| 72 ShelfModel* model_; | 76 ShelfModel* model_; |
| 73 | 77 |
| 74 std::set<std::string> pinned_apps_; | 78 std::set<std::string> pinned_apps_; |
| 75 | 79 |
| 76 // Tracks the ShelfID to app id mappings. | 80 // Tracks the ShelfID to app id mappings. |
| 77 std::map<ShelfID, std::string> shelf_id_to_app_id_map_; | 81 std::map<ShelfID, std::string> shelf_id_to_app_id_map_; |
| 78 | 82 |
| 79 DISALLOW_COPY_AND_ASSIGN(TestShelfDelegate); | 83 DISALLOW_COPY_AND_ASSIGN(TestShelfDelegate); |
| 80 }; | 84 }; |
| 81 | 85 |
| 82 } // namespace test | 86 } // namespace test |
| 83 } // namespace ash | 87 } // namespace ash |
| 84 | 88 |
| 85 #endif // ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ | 89 #endif // ASH_COMMON_TEST_TEST_SHELF_DELEGATE_H_ |
| OLD | NEW |