| 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/browser_driver/browser_driver_application_delegate.h" | 5 #include "mash/browser_driver/browser_driver_application_delegate.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } // namespace | 48 } // namespace |
| 49 | 49 |
| 50 BrowserDriverApplicationDelegate::BrowserDriverApplicationDelegate() | 50 BrowserDriverApplicationDelegate::BrowserDriverApplicationDelegate() |
| 51 : connector_(nullptr), | 51 : connector_(nullptr), |
| 52 binding_(this), | 52 binding_(this), |
| 53 weak_factory_(this) {} | 53 weak_factory_(this) {} |
| 54 | 54 |
| 55 BrowserDriverApplicationDelegate::~BrowserDriverApplicationDelegate() {} | 55 BrowserDriverApplicationDelegate::~BrowserDriverApplicationDelegate() {} |
| 56 | 56 |
| 57 void BrowserDriverApplicationDelegate::Initialize( | 57 void BrowserDriverApplicationDelegate::Initialize( |
| 58 mojo::Connector* connector, | 58 shell::Connector* connector, |
| 59 const mojo::Identity& identity, | 59 const shell::Identity& identity, |
| 60 uint32_t id) { | 60 uint32_t id) { |
| 61 connector_ = connector; | 61 connector_ = connector; |
| 62 AddAccelerators(); | 62 AddAccelerators(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool BrowserDriverApplicationDelegate::AcceptConnection( | 65 bool BrowserDriverApplicationDelegate::AcceptConnection( |
| 66 mojo::Connection* connection) { | 66 shell::Connection* connection) { |
| 67 return true; | 67 return true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool BrowserDriverApplicationDelegate::ShellConnectionLost() { | 70 bool BrowserDriverApplicationDelegate::ShellConnectionLost() { |
| 71 // Prevent the code in AddAccelerators() from keeping this app alive. | 71 // Prevent the code in AddAccelerators() from keeping this app alive. |
| 72 binding_.set_connection_error_handler(base::Bind(&DoNothing)); | 72 binding_.set_connection_error_handler(base::Bind(&DoNothing)); |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void BrowserDriverApplicationDelegate::OnAccelerator( | 76 void BrowserDriverApplicationDelegate::OnAccelerator( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 107 for (const AcceleratorSpec& spec : g_spec) { | 107 for (const AcceleratorSpec& spec : g_spec) { |
| 108 registrar->AddAccelerator( | 108 registrar->AddAccelerator( |
| 109 static_cast<uint32_t>(spec.id), | 109 static_cast<uint32_t>(spec.id), |
| 110 mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags), | 110 mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags), |
| 111 base::Bind(&AssertTrue)); | 111 base::Bind(&AssertTrue)); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace browser_driver | 115 } // namespace browser_driver |
| 116 } // namespace main | 116 } // namespace main |
| OLD | NEW |