| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 5 #ifndef SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| 6 #define SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 6 #define SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "services/catalog/store.h" | 12 #include "services/catalog/store.h" |
| 13 | 13 |
| 14 namespace mojo { | |
| 15 namespace shell { | 14 namespace shell { |
| 16 | 15 |
| 17 // ApplicationCatalogStore implementation that takes the ListValue to return | 16 // ApplicationCatalogStore implementation that takes the ListValue to return |
| 18 // as store. | 17 // as store. |
| 19 class TestCatalogStore : public catalog::Store { | 18 class TestCatalogStore : public catalog::Store { |
| 20 public: | 19 public: |
| 21 explicit TestCatalogStore(scoped_ptr<base::ListValue> store); | 20 explicit TestCatalogStore(std::unique_ptr<base::ListValue> store); |
| 22 ~TestCatalogStore() override; | 21 ~TestCatalogStore() override; |
| 23 | 22 |
| 24 bool get_store_called() const { return get_store_called_; } | 23 bool get_store_called() const { return get_store_called_; } |
| 25 | 24 |
| 26 // ApplicationCatalogStore: | 25 // ApplicationCatalogStore: |
| 27 const base::ListValue* GetStore() override; | 26 const base::ListValue* GetStore() override; |
| 28 void UpdateStore(scoped_ptr<base::ListValue> store) override; | 27 void UpdateStore(std::unique_ptr<base::ListValue> store) override; |
| 29 | 28 |
| 30 private: | 29 private: |
| 31 bool get_store_called_ = false; | 30 bool get_store_called_ = false; |
| 32 scoped_ptr<base::ListValue> store_; | 31 std::unique_ptr<base::ListValue> store_; |
| 33 | 32 |
| 34 DISALLOW_COPY_AND_ASSIGN(TestCatalogStore); | 33 DISALLOW_COPY_AND_ASSIGN(TestCatalogStore); |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 // Returns a dictionary for an app with the specified name, display name and a | 36 // Returns a dictionary for an app with the specified name, display name and a |
| 38 // permissive filter. | 37 // permissive filter. |
| 39 scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( | 38 std::unique_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( |
| 40 const std::string& name, | 39 const std::string& name, |
| 41 const std::string& display_name); | 40 const std::string& display_name); |
| 42 | 41 |
| 43 } // namespace shell | 42 } // namespace shell |
| 44 } // namespace mojo | |
| 45 | 43 |
| 46 #endif // SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 44 #endif // SERVICES_SHELL_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| OLD | NEW |