X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fchromeos%2Foffline%2Foffline_load_page.cc;h=02f51d4a3256b9ee8aef2f51193bafb9d9910ee5;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=02198472188c31ba066aabd81d9fe7a4b9d2477d;hpb=4b53d56b8a1db20d4089f6d4f37126d43f907125;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/chromeos/offline/offline_load_page.cc b/src/chrome/browser/chromeos/offline/offline_load_page.cc index 0219847..02f51d4 100644 --- a/src/chrome/browser/chromeos/offline/offline_load_page.cc +++ b/src/chrome/browser/chromeos/offline/offline_load_page.cc @@ -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" @@ -17,11 +18,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" #include "chrome/browser/tab_contents/tab_util.h" -#include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/extensions/manifest_handlers/icons_handler.h" @@ -32,6 +31,8 @@ #include "content/public/browser/interstitial_page.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/web_contents.h" +#include "extensions/browser/extension_system.h" +#include "extensions/common/extension.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -48,15 +49,6 @@ using content::BrowserThread; using content::InterstitialPage; using content::WebContents; -namespace { - -// A utility function to set the dictionary's value given by |resource_id|. -void SetString(DictionaryValue* strings, const char* name, int resource_id) { - strings->SetString(name, l10n_util::GetStringUTF16(resource_id)); -} - -} // namespace - namespace chromeos { OfflineLoadPage::OfflineLoadPage(WebContents* web_contents, @@ -104,7 +96,7 @@ std::string OfflineLoadPage::GetHTMLContents() { const std::string accept_languages = profile->GetPrefs()->GetString(prefs::kAcceptLanguages); LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, - net::kErrorDomain, url_, false, locale, + net::kErrorDomain, url_, false, false, locale, accept_languages, &error_strings); resource_id = IDR_OFFLINE_NET_LOAD_HTML; } @@ -146,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; }