| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_ | |
| 6 #define MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <map> | |
| 11 | |
| 12 #include "base/callback.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "base/memory/weak_ptr.h" | |
| 15 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" | |
| 16 #include "mojo/public/cpp/bindings/binding.h" | |
| 17 #include "services/catalog/public/interfaces/catalog.mojom.h" | |
| 18 #include "services/shell/public/cpp/shell_client.h" | |
| 19 | |
| 20 namespace mash { | |
| 21 namespace browser_driver { | |
| 22 | |
| 23 class BrowserDriverApplicationDelegate : public shell::ShellClient, | |
| 24 public mus::mojom::AcceleratorHandler { | |
| 25 public: | |
| 26 BrowserDriverApplicationDelegate(); | |
| 27 ~BrowserDriverApplicationDelegate() override; | |
| 28 | |
| 29 private: | |
| 30 void OnAvailableCatalogEntries( | |
| 31 const mojo::Array<catalog::mojom::EntryPtr>& entries); | |
| 32 | |
| 33 // shell::ShellClient: | |
| 34 void Initialize(shell::Connector* connector, | |
| 35 const shell::Identity& identity, | |
| 36 uint32_t id) override; | |
| 37 bool AcceptConnection(shell::Connection* connection) override; | |
| 38 bool ShellConnectionLost() override; | |
| 39 | |
| 40 // mus::mojom::AcceleratorHandler: | |
| 41 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; | |
| 42 | |
| 43 void AddAccelerators(); | |
| 44 | |
| 45 shell::Connector* connector_; | |
| 46 catalog::mojom::CatalogPtr catalog_; | |
| 47 mojo::Binding<mus::mojom::AcceleratorHandler> binding_; | |
| 48 base::WeakPtrFactory<BrowserDriverApplicationDelegate> weak_factory_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(BrowserDriverApplicationDelegate); | |
| 51 }; | |
| 52 | |
| 53 } // namespace browser_driver | |
| 54 } // namespace mash | |
| 55 | |
| 56 #endif // MASH_BROWSER_DRIVER_BROWSER_DRIVER_APPLICATION_DELEGATE_H_ | |
| OLD | NEW |