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

Unified Diff: chrome/browser/ui/ash/network_connect_delegate_chromeos.cc

Issue 2430003002: NetworkConnect::Delegate: service_path -> network_id (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/network_connect_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/network_connect_delegate_chromeos.cc b/chrome/browser/ui/ash/network_connect_delegate_chromeos.cc
index d509ce2015800dbe338491aa0b66d3296da67990..ff018adc130c15d20c4b8d94682358c73c1df99b 100644
--- a/chrome/browser/ui/ash/network_connect_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/network_connect_delegate_chromeos.cc
@@ -15,6 +15,11 @@
#include "chrome/browser/chromeos/sim_dialog_delegate.h"
#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
+#include "chromeos/network/network_handler.h"
+#include "chromeos/network/network_state.h"
+#include "chromeos/network/network_state_handler.h"
+
+namespace chromeos {
namespace {
@@ -41,21 +46,31 @@ gfx::NativeWindow GetNativeWindow() {
container_id);
}
+std::string GetServicePathFromNetworkId(const std::string& network_id) {
James Cook 2016/10/18 23:26:25 Can you put this in a static function in SystemTra
stevenjb 2016/10/19 17:06:44 Moved to the dialog code.
+ const NetworkState* network =
+ NetworkHandler::Get()->network_state_handler()->GetNetworkStateFromGuid(
+ network_id);
+ if (!network) {
+ LOG(ERROR) << "Network ID not found: " << network_id;
+ return "";
James Cook 2016/10/18 23:26:25 nit: std::string()
stevenjb 2016/10/19 17:06:44 Acknowledged.
+ }
+ return network->path();
+}
+
} // namespace
-namespace chromeos {
+NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS() {}
-NetworkConnectDelegateChromeOS::NetworkConnectDelegateChromeOS() {
-}
-
-NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {
-}
+NetworkConnectDelegateChromeOS::~NetworkConnectDelegateChromeOS() {}
void NetworkConnectDelegateChromeOS::ShowNetworkConfigure(
const std::string& network_id) {
if (!IsUIAvailable())
return;
- NetworkConfigView::Show(network_id, GetNativeWindow());
+ std::string service_path = GetServicePathFromNetworkId(network_id);
+ if (service_path.empty())
+ return;
+ NetworkConfigView::Show(service_path, GetNativeWindow());
}
void NetworkConnectDelegateChromeOS::ShowNetworkSettingsForGuid(
@@ -80,9 +95,12 @@ void NetworkConnectDelegateChromeOS::ShowMobileSimDialog() {
}
void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog(
- const std::string& service_path) {
+ const std::string& network_id) {
if (!IsUIAvailable())
return;
+ std::string service_path = GetServicePathFromNetworkId(network_id);
+ if (service_path.empty())
+ return;
MobileSetupDialog::Show(service_path);
}
« no previous file with comments | « chrome/browser/chromeos/status/data_promo_notification_unittest.cc ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698