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

Side by Side Diff: net/base/network_change_notifier_linux.cc

Issue 899573002: Add WiFi SSID getter to NetworkChangeNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 years, 10 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 | « net/base/network_change_notifier_linux.h ('k') | net/base/network_change_notifier_mac.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/base/network_change_notifier_linux.h" 5 #include "net/base/network_change_notifier_linux.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "net/base/address_tracker_linux.h" 10 #include "net/base/address_tracker_linux.h"
11 #include "net/dns/dns_config_service.h" 11 #include "net/dns/dns_config_service.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 class NetworkChangeNotifierLinux::Thread : public base::Thread { 15 class NetworkChangeNotifierLinux::Thread : public base::Thread {
16 public: 16 public:
17 Thread(); 17 Thread();
18 ~Thread() override; 18 ~Thread() override;
19 19
20 // Plumbing for NetworkChangeNotifier::GetCurrentConnectionType. 20 // Plumbing for NetworkChangeNotifier::GetCurrentConnectionType.
21 // Safe to call from any thread. 21 // Safe to call from any thread.
22 NetworkChangeNotifier::ConnectionType GetCurrentConnectionType() { 22 NetworkChangeNotifier::ConnectionType GetCurrentConnectionType() {
23 return address_tracker_.GetCurrentConnectionType(); 23 return address_tracker_.GetCurrentConnectionType();
24 } 24 }
25 25
26 std::string GetCurrentWiFiSSID() {
27 return address_tracker_.GetCurrentWiFiSSID();
28 }
29
26 const internal::AddressTrackerLinux* address_tracker() const { 30 const internal::AddressTrackerLinux* address_tracker() const {
27 return &address_tracker_; 31 return &address_tracker_;
28 } 32 }
29 33
30 protected: 34 protected:
31 // base::Thread 35 // base::Thread
32 void Init() override; 36 void Init() override;
33 void CleanUp() override; 37 void CleanUp() override;
34 38
35 private: 39 private:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 base::TimeDelta::FromMilliseconds(1500); 119 base::TimeDelta::FromMilliseconds(1500);
116 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); 120 params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500);
117 return params; 121 return params;
118 } 122 }
119 123
120 NetworkChangeNotifier::ConnectionType 124 NetworkChangeNotifier::ConnectionType
121 NetworkChangeNotifierLinux::GetCurrentConnectionType() const { 125 NetworkChangeNotifierLinux::GetCurrentConnectionType() const {
122 return notifier_thread_->GetCurrentConnectionType(); 126 return notifier_thread_->GetCurrentConnectionType();
123 } 127 }
124 128
129 std::string NetworkChangeNotifierLinux::GetCurrentWiFiSSID() const {
130 return notifier_thread_->GetCurrentWiFiSSID();
131 }
132
125 const internal::AddressTrackerLinux* 133 const internal::AddressTrackerLinux*
126 NetworkChangeNotifierLinux::GetAddressTrackerInternal() const { 134 NetworkChangeNotifierLinux::GetAddressTrackerInternal() const {
127 return notifier_thread_->address_tracker(); 135 return notifier_thread_->address_tracker();
128 } 136 }
129 137
130 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_change_notifier_linux.h ('k') | net/base/network_change_notifier_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698