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

Side by Side Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 650074: New network menu button UI for ChromeOS.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/chromeos/cros/network_library.h" 5 #include "chrome/browser/chromeos/cros/network_library.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/chrome_thread.h" 10 #include "chrome/browser/chrome_thread.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 void NetworkLibrary::NotifyNetworkTraffic(int traffic_type) { 382 void NetworkLibrary::NotifyNetworkTraffic(int traffic_type) {
383 FOR_EACH_OBSERVER(Observer, observers_, NetworkTraffic(this, traffic_type)); 383 FOR_EACH_OBSERVER(Observer, observers_, NetworkTraffic(this, traffic_type));
384 } 384 }
385 385
386 bool NetworkLibrary::Connected() const { 386 bool NetworkLibrary::Connected() const {
387 return ethernet_connected() || wifi_connected() || cellular_connected(); 387 return ethernet_connected() || wifi_connected() || cellular_connected();
388 } 388 }
389 389
390 const std::string& NetworkLibrary::IPAddress() const {
391 // Returns highest priority IP address.
392 if (ethernet_connected())
393 return ethernet_.ip_address;
394 if (wifi_connected())
395 return wifi_.ip_address;
396 if (cellular_connected())
397 return cellular_.ip_address;
398 return ethernet_.ip_address;
399 }
400
390 } // namespace chromeos 401 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698