OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_linux.h" | 5 #include "extensions/browser/api/networking_private/networking_private_linux.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
17 #include "components/onc/onc_constants.h" | 17 #include "components/onc/onc_constants.h" |
18 #include "content/public/browser/browser_context.h" | |
19 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
20 #include "dbus/bus.h" | 19 #include "dbus/bus.h" |
21 #include "dbus/message.h" | 20 #include "dbus/message.h" |
22 #include "dbus/object_path.h" | 21 #include "dbus/object_path.h" |
23 #include "dbus/object_proxy.h" | 22 #include "dbus/object_proxy.h" |
24 #include "extensions/browser/api/networking_private/network_config_dbus_constant
s_linux.h" | 23 #include "extensions/browser/api/networking_private/network_config_dbus_constant
s_linux.h" |
25 #include "extensions/browser/api/networking_private/networking_private_api.h" | 24 #include "extensions/browser/api/networking_private/networking_private_api.h" |
26 #include "extensions/browser/api/networking_private/networking_private_delegate_
observer.h" | 25 #include "extensions/browser/api/networking_private/networking_private_delegate_
observer.h" |
27 | 26 |
28 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (!error->empty()) { | 128 if (!error->empty()) { |
130 failure_callback.Run(*error); | 129 failure_callback.Run(*error); |
131 return; | 130 return; |
132 } | 131 } |
133 success_callback.Run(std::move(properties)); | 132 success_callback.Run(std::move(properties)); |
134 } | 133 } |
135 | 134 |
136 } // namespace | 135 } // namespace |
137 | 136 |
138 NetworkingPrivateLinux::NetworkingPrivateLinux( | 137 NetworkingPrivateLinux::NetworkingPrivateLinux( |
139 content::BrowserContext* browser_context, | |
140 std::unique_ptr<VerifyDelegate> verify_delegate) | 138 std::unique_ptr<VerifyDelegate> verify_delegate) |
141 : NetworkingPrivateDelegate(std::move(verify_delegate)), | 139 : NetworkingPrivateDelegate(std::move(verify_delegate)), |
142 browser_context_(browser_context), | |
143 dbus_thread_("Networking Private DBus"), | 140 dbus_thread_("Networking Private DBus"), |
144 network_manager_proxy_(NULL) { | 141 network_manager_proxy_(NULL) { |
145 base::Thread::Options thread_options(base::MessageLoop::Type::TYPE_IO, 0); | 142 base::Thread::Options thread_options(base::MessageLoop::Type::TYPE_IO, 0); |
146 | 143 |
147 dbus_thread_.StartWithOptions(thread_options); | 144 dbus_thread_.StartWithOptions(thread_options); |
148 dbus_thread_.task_runner()->PostTask( | 145 dbus_thread_.task_runner()->PostTask( |
149 FROM_HERE, | 146 FROM_HERE, |
150 base::Bind(&NetworkingPrivateLinux::Initialize, base::Unretained(this))); | 147 base::Bind(&NetworkingPrivateLinux::Initialize, base::Unretained(this))); |
151 } | 148 } |
152 | 149 |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 base::Unretained(this), base::Passed(&guid_list))); | 1200 base::Unretained(this), base::Passed(&guid_list))); |
1204 } | 1201 } |
1205 | 1202 |
1206 void NetworkingPrivateLinux::OnNetworksChangedEventTask( | 1203 void NetworkingPrivateLinux::OnNetworksChangedEventTask( |
1207 std::unique_ptr<GuidList> guid_list) { | 1204 std::unique_ptr<GuidList> guid_list) { |
1208 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 1205 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
1209 OnNetworksChangedEventOnUIThread(*guid_list); | 1206 OnNetworksChangedEventOnUIThread(*guid_list); |
1210 } | 1207 } |
1211 | 1208 |
1212 } // namespace extensions | 1209 } // namespace extensions |
OLD | NEW |