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

Side by Side Diff: chrome/browser/ui/ash/vpn_list_forwarder.cc

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . Created 3 years, 11 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 "chrome/browser/ui/ash/vpn_list_forwarder.h" 5 #include "chrome/browser/ui/ash/vpn_list_forwarder.h"
6 6
7 #include "ash/public/interfaces/vpn_list.mojom.h" 7 #include "ash/public/interfaces/vpn_list.mojom.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 28 matching lines...) Expand all
39 return nullptr; 39 return nullptr;
40 40
41 return chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); 41 return chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user);
42 } 42 }
43 43
44 // Connects to the VpnList mojo interface in ash. 44 // Connects to the VpnList mojo interface in ash.
45 ash::mojom::VpnListPtr ConnectToVpnList() { 45 ash::mojom::VpnListPtr ConnectToVpnList() {
46 ash::mojom::VpnListPtr vpn_list; 46 ash::mojom::VpnListPtr vpn_list;
47 content::ServiceManagerConnection::GetForProcess() 47 content::ServiceManagerConnection::GetForProcess()
48 ->GetConnector() 48 ->GetConnector()
49 ->ConnectToInterface(ash_util::GetAshServiceName(), &vpn_list); 49 ->BindInterface(ash_util::GetAshServiceName(), &vpn_list);
50 return vpn_list; 50 return vpn_list;
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 VpnListForwarder::VpnListForwarder() : weak_factory_(this) { 55 VpnListForwarder::VpnListForwarder() : weak_factory_(this) {
56 if (user_manager::UserManager::Get()->GetPrimaryUser()) { 56 if (user_manager::UserManager::Get()->GetPrimaryUser()) {
57 // If a user is logged in, start observing the primary user's extension 57 // If a user is logged in, start observing the primary user's extension
58 // registry immediately. 58 // registry immediately.
59 AttachToPrimaryUserExtensionRegistry(); 59 AttachToPrimaryUserExtensionRegistry();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 void VpnListForwarder::AttachToPrimaryUserExtensionRegistry() { 146 void VpnListForwarder::AttachToPrimaryUserExtensionRegistry() {
147 DCHECK(!extension_registry_); 147 DCHECK(!extension_registry_);
148 extension_registry_ = 148 extension_registry_ =
149 extensions::ExtensionRegistry::Get(GetProfileForPrimaryUser()); 149 extensions::ExtensionRegistry::Get(GetProfileForPrimaryUser());
150 extension_registry_->AddObserver(this); 150 extension_registry_->AddObserver(this);
151 151
152 UpdateVPNProviders(); 152 UpdateVPNProviders();
153 } 153 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/volume_controller.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698