| OLD | NEW |
| 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/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 | 6 |
| 7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 | 126 |
| 127 void OfflineLoadPage::CommandReceived(const std::string& cmd) { | 127 void OfflineLoadPage::CommandReceived(const std::string& cmd) { |
| 128 std::string command(cmd); | 128 std::string command(cmd); |
| 129 // The Jasonified response has quotes, remove them. | 129 // The Jasonified response has quotes, remove them. |
| 130 if (command.length() > 1 && command[0] == '"') { | 130 if (command.length() > 1 && command[0] == '"') { |
| 131 command = command.substr(1, command.length() - 2); | 131 command = command.substr(1, command.length() - 2); |
| 132 } | 132 } |
| 133 // TODO(oshima): record action for metrics. | 133 // TODO(oshima): record action for metrics. |
| 134 if (command == "open_network_settings") { | 134 if (command == "open_network_settings") { |
| 135 ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings(""); | 135 ash::Shell::GetInstance() |
| 136 ->system_tray_delegate() |
| 137 ->ShowNetworkSettingsForGuid(""); |
| 136 } else if (command == "open_connectivity_diagnostics") { | 138 } else if (command == "open_connectivity_diagnostics") { |
| 137 Profile* profile = Profile::FromBrowserContext( | 139 Profile* profile = Profile::FromBrowserContext( |
| 138 web_contents_->GetBrowserContext()); | 140 web_contents_->GetBrowserContext()); |
| 139 const extensions::Extension* extension = | 141 const extensions::Extension* extension = |
| 140 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( | 142 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( |
| 141 "kodldpbjkkmmnilagfdheibampofhaom", | 143 "kodldpbjkkmmnilagfdheibampofhaom", |
| 142 extensions::ExtensionRegistry::EVERYTHING); | 144 extensions::ExtensionRegistry::EVERYTHING); |
| 143 apps::LaunchPlatformAppWithUrl(profile, extension, "", | 145 apps::LaunchPlatformAppWithUrl(profile, extension, "", |
| 144 GURL::EmptyGURL(), GURL::EmptyGURL()); | 146 GURL::EmptyGURL(), GURL::EmptyGURL()); |
| 145 | 147 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 159 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 161 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
| 160 DVLOG(1) << "ConnectionTypeObserver notification received: state=" | 162 DVLOG(1) << "ConnectionTypeObserver notification received: state=" |
| 161 << (online ? "online" : "offline"); | 163 << (online ? "online" : "offline"); |
| 162 if (online) { | 164 if (online) { |
| 163 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 165 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
| 164 interstitial_page_->Proceed(); | 166 interstitial_page_->Proceed(); |
| 165 } | 167 } |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace chromeos | 170 } // namespace chromeos |
| OLD | NEW |