Commit bd0a3ae6 authored by zork@chromium.org's avatar zork@chromium.org

Properly launch the connectivity diagnostics app from the offline page

BUG=332175
R=xiyuan@chromium.org

Review URL: https://codereview.chromium.org/129693002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243717 0039d316-1c4b-4281-b951-d872f2087c98
parent 3176e09d
......@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/offline/offline_load_page.h"
#include "apps/launcher.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/system/tray/system_tray_delegate.h"
......@@ -137,6 +138,14 @@ void OfflineLoadPage::CommandReceived(const std::string& cmd) {
// TODO(oshima): record action for metrics.
if (command == "open_network_settings") {
ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings("");
} else if (command == "open_connectivity_diagnostics") {
Profile* profile = Profile::FromBrowserContext(
web_contents_->GetBrowserContext());
const extensions::Extension* extension = profile->GetExtensionService()->
GetInstalledExtension("kodldpbjkkmmnilagfdheibampofhaom");
apps::LaunchPlatformAppWithUrl(profile, extension, "",
GURL::EmptyGURL(), GURL::EmptyGURL());
} else {
LOG(WARNING) << "Unknown command:" << cmd;
}
......
......@@ -14,11 +14,8 @@ function toggleHelpBox() {
}
function diagnoseErrors() {
var extensionId = 'idddmepepmjcgiedknnmlbadcokidhoa';
var diagnoseFrame = $('diagnose-frame');
diagnoseFrame.innerHTML =
'<iframe src="chrome-extension://' + extensionId +
'/index.html"></iframe>';
window.domAutomationController.setAutomationId(1);
window.domAutomationController.send('open_connectivity_diagnostics');
}
// Subframes use a different layout but the same html file. This is to make it
......
......@@ -38,7 +38,6 @@
</div>
<button id="diagnose-button" onclick="diagnoseErrors()"
jscontent="diagnose" jsdisplay="diagnose"></button>
<div id="diagnose-frame" class="hidden"></div>
<div class="error-code" jscontent="errorCode"></div>
</div>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment