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

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 11367048: This is the first pass at making GetIPConfigs asynchronous. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 (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 "chrome/browser/chromeos/system/ash_system_tray_delegate.h" 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/system/audio/audio_observer.h" 9 #include "ash/system/audio/audio_observer.h"
10 #include "ash/system/bluetooth/bluetooth_observer.h" 10 #include "ash/system/bluetooth/bluetooth_observer.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 std::string* wifi_mac_address) OVERRIDE { 574 std::string* wifi_mac_address) OVERRIDE {
575 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); 575 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary();
576 if (crosnet->Connected()) 576 if (crosnet->Connected())
577 *ip_address = crosnet->IPAddress(); 577 *ip_address = crosnet->IPAddress();
578 else 578 else
579 *ip_address = std::string(); 579 *ip_address = std::string();
580 580
581 *ethernet_mac_address = std::string(); 581 *ethernet_mac_address = std::string();
582 const NetworkDevice* ether = crosnet->FindEthernetDevice(); 582 const NetworkDevice* ether = crosnet->FindEthernetDevice();
583 if (ether) 583 if (ether)
584 crosnet->GetIPConfigs(ether->device_path(), ethernet_mac_address, 584 crosnet->GetIPConfigsAndBlock(ether->device_path(), ethernet_mac_address,
585 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); 585 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX);
586 586
587 *wifi_mac_address = std::string(); 587 *wifi_mac_address = std::string();
588 const NetworkDevice* wifi = crosnet->wifi_enabled() ? 588 const NetworkDevice* wifi = crosnet->wifi_enabled() ?
589 crosnet->FindWifiDevice() : NULL; 589 crosnet->FindWifiDevice() : NULL;
590 if (wifi) 590 if (wifi)
591 crosnet->GetIPConfigs(wifi->device_path(), wifi_mac_address, 591 crosnet->GetIPConfigsAndBlock(wifi->device_path(), wifi_mac_address,
592 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX); 592 NetworkLibrary::FORMAT_COLON_SEPARATED_HEX);
593 } 593 }
594 594
595 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE { 595 virtual void ConnectToNetwork(const std::string& network_id) OVERRIDE {
596 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); 596 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary();
597 Network* network = crosnet->FindNetworkByPath(network_id); 597 Network* network = crosnet->FindNetworkByPath(network_id);
598 if (network) 598 if (network)
599 network_menu_->ConnectToNetwork(network); 599 network_menu_->ConnectToNetwork(network);
600 } 600 }
601 601
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1301 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1302 }; 1302 };
1303 1303
1304 } // namespace 1304 } // namespace
1305 1305
1306 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { 1306 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) {
1307 return new chromeos::SystemTrayDelegate(tray); 1307 return new chromeos::SystemTrayDelegate(tray);
1308 } 1308 }
1309 1309
1310 } // namespace chromeos 1310 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698