| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "mash/app_driver/app_driver.h" | 5 #include "mash/app_driver/app_driver.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void DoNothing() {} | 53 void DoNothing() {} |
| 54 | 54 |
| 55 } // namespace | 55 } // namespace |
| 56 | 56 |
| 57 AppDriver::AppDriver() | 57 AppDriver::AppDriver() |
| 58 : connector_(nullptr), binding_(this), weak_factory_(this) {} | 58 : connector_(nullptr), binding_(this), weak_factory_(this) {} |
| 59 | 59 |
| 60 AppDriver::~AppDriver() {} | 60 AppDriver::~AppDriver() {} |
| 61 | 61 |
| 62 void AppDriver::OnAvailableCatalogEntries( | 62 void AppDriver::OnAvailableCatalogEntries( |
| 63 const mojo::Array<catalog::mojom::EntryPtr>& entries) { | 63 mojo::Array<catalog::mojom::EntryPtr> entries) { |
| 64 if (entries.empty()) { | 64 if (entries.empty()) { |
| 65 LOG(ERROR) << "Unable to install accelerators for launching chrome."; | 65 LOG(ERROR) << "Unable to install accelerators for launching chrome."; |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 mus::mojom::AcceleratorRegistrarPtr registrar; | 69 mus::mojom::AcceleratorRegistrarPtr registrar; |
| 70 connector_->ConnectToInterface(entries[0]->name, ®istrar); | 70 connector_->ConnectToInterface(entries[0]->name, ®istrar); |
| 71 | 71 |
| 72 if (binding_.is_bound()) | 72 if (binding_.is_bound()) |
| 73 binding_.Unbind(); | 73 binding_.Unbind(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 void AppDriver::AddAccelerators() { | 131 void AppDriver::AddAccelerators() { |
| 132 connector_->ConnectToInterface("mojo:catalog", &catalog_); | 132 connector_->ConnectToInterface("mojo:catalog", &catalog_); |
| 133 catalog_->GetEntriesProvidingClass( | 133 catalog_->GetEntriesProvidingClass( |
| 134 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, | 134 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, |
| 135 weak_factory_.GetWeakPtr())); | 135 weak_factory_.GetWeakPtr())); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace app_driver | 138 } // namespace app_driver |
| 139 } // namespace mash | 139 } // namespace mash |
| OLD | NEW |