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_TEST_TEST_SHELF_DELEGATE_H_ | 5 #ifndef ASH_TEST_TEST_SHELF_DELEGATE_H_ |
6 #define ASH_TEST_TEST_SHELF_DELEGATE_H_ | 6 #define ASH_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> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void OnWindowDestroying(aura::Window* window) override; | 49 void OnWindowDestroying(aura::Window* window) override; |
50 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; | 50 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override; |
51 | 51 |
52 // ShelfDelegate implementation. | 52 // ShelfDelegate implementation. |
53 void OnShelfCreated(Shelf* shelf) override; | 53 void OnShelfCreated(Shelf* shelf) override; |
54 void OnShelfDestroyed(Shelf* shelf) override; | 54 void OnShelfDestroyed(Shelf* shelf) override; |
55 void OnShelfAlignmentChanged(Shelf* shelf) override; | 55 void OnShelfAlignmentChanged(Shelf* shelf) override; |
56 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override; | 56 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override; |
57 void OnShelfAutoHideStateChanged(Shelf* shelf) override; | 57 void OnShelfAutoHideStateChanged(Shelf* shelf) override; |
58 void OnShelfVisibilityStateChanged(Shelf* shelf) override; | 58 void OnShelfVisibilityStateChanged(Shelf* shelf) override; |
59 ShelfID GetShelfIDForAppID(const std::string& app_id) override; | 59 ShelfID GetShelfIDForAppID(const std::string& app_id, |
| 60 const std::string& app_shelf_id) override; |
60 bool HasShelfIDToAppIDMapping(ShelfID id) const override; | 61 bool HasShelfIDToAppIDMapping(ShelfID id) const override; |
61 const std::string& GetAppIDForShelfID(ShelfID id) override; | 62 const std::string& GetAppIDForShelfID(ShelfID id) override; |
62 void PinAppWithID(const std::string& app_id) override; | 63 void PinAppWithID(const std::string& app_id) override; |
63 bool IsAppPinned(const std::string& app_id) override; | 64 bool IsAppPinned(const std::string& app_id) override; |
64 void UnpinAppWithID(const std::string& app_id) override; | 65 void UnpinAppWithID(const std::string& app_id) override; |
65 | 66 |
66 private: | 67 private: |
67 // Adds a mapping from a ShelfID to an app id. | 68 // Adds a mapping from a ShelfID to an app id. |
68 void AddShelfIDToAppIDMapping(ShelfID shelf_id, const std::string& app_id); | 69 void AddShelfIDToAppIDMapping(ShelfID shelf_id, const std::string& app_id); |
69 | 70 |
70 // Removes the mapping from a ShelfID to an app id. | 71 // Removes the mapping from a ShelfID to an app id. |
71 void RemoveShelfIDToAppIDMapping(ShelfID shelf_id); | 72 void RemoveShelfIDToAppIDMapping(ShelfID shelf_id); |
72 | 73 |
73 static TestShelfDelegate* instance_; | 74 static TestShelfDelegate* instance_; |
74 | 75 |
75 ShelfModel* model_; | 76 ShelfModel* model_; |
76 | 77 |
77 std::set<std::string> pinned_apps_; | 78 std::set<std::string> pinned_apps_; |
78 | 79 |
79 // Tracks the ShelfID to app id mappings. | 80 // Tracks the ShelfID to app id mappings. |
80 std::map<ShelfID, std::string> shelf_id_to_app_id_map_; | 81 std::map<ShelfID, std::string> shelf_id_to_app_id_map_; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(TestShelfDelegate); | 83 DISALLOW_COPY_AND_ASSIGN(TestShelfDelegate); |
83 }; | 84 }; |
84 | 85 |
85 } // namespace test | 86 } // namespace test |
86 } // namespace ash | 87 } // namespace ash |
87 | 88 |
88 #endif // ASH_TEST_TEST_SHELF_DELEGATE_H_ | 89 #endif // ASH_TEST_TEST_SHELF_DELEGATE_H_ |
OLD | NEW |