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