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

Side by Side Diff: services/ui/test_wm/test_wm.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 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
« no previous file with comments | « services/ui/service.cc ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "mojo/public/cpp/bindings/binding.h" 10 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 CHECK(!started_); 56 CHECK(!started_);
57 started_ = true; 57 started_ = true;
58 screen_ = base::MakeUnique<display::ScreenBase>(); 58 screen_ = base::MakeUnique<display::ScreenBase>();
59 display::Screen::SetScreenInstance(screen_.get()); 59 display::Screen::SetScreenInstance(screen_.get());
60 aura_env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS); 60 aura_env_ = aura::Env::CreateInstance(aura::Env::Mode::MUS);
61 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>( 61 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>(
62 context()->connector(), this, this); 62 context()->connector(), this, this);
63 aura_env_->SetWindowTreeClient(window_tree_client_.get()); 63 aura_env_->SetWindowTreeClient(window_tree_client_.get());
64 window_tree_client_->ConnectAsWindowManager(); 64 window_tree_client_->ConnectAsWindowManager();
65 } 65 }
66 66 void OnBindInterface(const service_manager::ServiceInfo& source_info,
67 bool OnConnect(const service_manager::ServiceInfo& remote_info, 67 const std::string& interface_name,
68 service_manager::InterfaceRegistry* registry) override { 68 mojo::ScopedMessagePipeHandle interface_pipe) override {}
69 return false;
70 }
71 69
72 // aura::WindowTreeClientDelegate: 70 // aura::WindowTreeClientDelegate:
73 void OnEmbed( 71 void OnEmbed(
74 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override { 72 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override {
75 // WindowTreeClients configured as the window manager should never get 73 // WindowTreeClients configured as the window manager should never get
76 // OnEmbed(). 74 // OnEmbed().
77 NOTREACHED(); 75 NOTREACHED();
78 } 76 }
79 void OnLostConnection(aura::WindowTreeClient* client) override { 77 void OnLostConnection(aura::WindowTreeClient* client) override {
80 window_tree_host_.reset(); 78 window_tree_host_.reset();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DISALLOW_COPY_AND_ASSIGN(TestWM); 194 DISALLOW_COPY_AND_ASSIGN(TestWM);
197 }; 195 };
198 196
199 } // namespace test 197 } // namespace test
200 } // namespace ui 198 } // namespace ui
201 199
202 MojoResult ServiceMain(MojoHandle service_request_handle) { 200 MojoResult ServiceMain(MojoHandle service_request_handle) {
203 service_manager::ServiceRunner runner(new ui::test::TestWM); 201 service_manager::ServiceRunner runner(new ui::test::TestWM);
204 return runner.Run(service_request_handle); 202 return runner.Run(service_request_handle);
205 } 203 }
OLDNEW
« no previous file with comments | « services/ui/service.cc ('k') | services/ui/ws/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698