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

Side by Side Diff: ash/common/new_window_client_proxy.cc

Issue 2509853002: Convert //mash to define service names in mojom (Closed)
Patch Set: . Created 4 years, 1 month 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 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 "ash/common/new_window_client_proxy.h" 5 #include "ash/common/new_window_client_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/common/service_names.mojom.h"
8 #include "services/service_manager/public/cpp/connector.h" 9 #include "services/service_manager/public/cpp/connector.h"
9 10
10 namespace ash { 11 namespace ash {
11 12
12 NewWindowClientProxy::NewWindowClientProxy( 13 NewWindowClientProxy::NewWindowClientProxy(
13 service_manager::Connector* connector) 14 service_manager::Connector* connector)
14 : connector_(connector) {} 15 : connector_(connector) {}
15 16
16 NewWindowClientProxy::~NewWindowClientProxy() {} 17 NewWindowClientProxy::~NewWindowClientProxy() {}
17 18
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 62 }
62 63
63 void NewWindowClientProxy::EnsureInterface() { 64 void NewWindowClientProxy::EnsureInterface() {
64 // |connector_| can be null in unit tests. We check this at first usage 65 // |connector_| can be null in unit tests. We check this at first usage
65 // instead of during construction because a NewWindowClientProxy is always 66 // instead of during construction because a NewWindowClientProxy is always
66 // created and is then replaced with a mock in the unit tests. 67 // created and is then replaced with a mock in the unit tests.
67 DCHECK(connector_); 68 DCHECK(connector_);
68 69
69 if (client_) 70 if (client_)
70 return; 71 return;
71 connector_->ConnectToInterface("content_browser", &client_); 72 connector_->ConnectToInterface(content::mojom::kBrowserServiceName, &client_);
72 client_.set_connection_error_handler(base::Bind( 73 client_.set_connection_error_handler(base::Bind(
73 &NewWindowClientProxy::OnClientConnectionError, base::Unretained(this))); 74 &NewWindowClientProxy::OnClientConnectionError, base::Unretained(this)));
74 } 75 }
75 76
76 void NewWindowClientProxy::OnClientConnectionError() { 77 void NewWindowClientProxy::OnClientConnectionError() {
77 client_.reset(); 78 client_.reset();
78 } 79 }
79 80
80 } // namespace ash 81 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/system/tray/system_tray_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698