Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: mash/browser_driver/browser_driver_application_delegate.cc

Issue 1814223002: Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 mojo::Connection* connection) {
67 return true; 67 return true;
68 } 68 }
69 69
70 void 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 base::MessageLoop::current()->QuitWhenIdle(); 73 return true;
74 } 74 }
75 75
76 void BrowserDriverApplicationDelegate::OnAccelerator( 76 void BrowserDriverApplicationDelegate::OnAccelerator(
77 uint32_t id, mus::mojom::EventPtr event) { 77 uint32_t id, mus::mojom::EventPtr event) {
78 switch (static_cast<Accelerator>(id)) { 78 switch (static_cast<Accelerator>(id)) {
79 case Accelerator::NewWindow: 79 case Accelerator::NewWindow:
80 case Accelerator::NewTab: 80 case Accelerator::NewTab:
81 case Accelerator::NewIncognitoWindow: 81 case Accelerator::NewIncognitoWindow:
82 connector_->Connect("exe:chrome"); 82 connector_->Connect("exe:chrome");
83 // TODO(beng): have Chrome export a service that allows it to be driven by 83 // TODO(beng): have Chrome export a service that allows it to be driven by
(...skipping 23 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « mash/browser_driver/browser_driver_application_delegate.h ('k') | mash/example/window_type_launcher/window_type_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698