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

Side by Side Diff: chrome/browser/chromeos/offline/offline_load_page.cc

Issue 24503004: Show IDN in error screens (DNS failure etc.) (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 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/offline/offline_load_page.h" 5 #include "chrome/browser/chromeos/offline/offline_load_page.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 // Extension service does not exist in test. 96 // Extension service does not exist in test.
97 if (extensions_service) 97 if (extensions_service)
98 extension = extensions_service->extensions()->GetHostedAppByURL(url_); 98 extension = extensions_service->extensions()->GetHostedAppByURL(url_);
99 99
100 if (extension && !extension->from_bookmark()) { 100 if (extension && !extension->from_bookmark()) {
101 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings); 101 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings);
102 resource_id = IDR_OFFLINE_APP_LOAD_HTML; 102 resource_id = IDR_OFFLINE_APP_LOAD_HTML;
103 } else { 103 } else {
104 const std::string locale = g_browser_process->GetApplicationLocale(); 104 const std::string locale = g_browser_process->GetApplicationLocale();
105 const std::string accept_languages =
106 profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
105 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, 107 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED,
106 net::kErrorDomain, url_, false, locale, 108 net::kErrorDomain, url_, false, locale,
107 &error_strings); 109 accept_languages, &error_strings);
108 resource_id = IDR_OFFLINE_NET_LOAD_HTML; 110 resource_id = IDR_OFFLINE_NET_LOAD_HTML;
109 } 111 }
110 112
111 const base::StringPiece template_html( 113 const base::StringPiece template_html(
112 ResourceBundle::GetSharedInstance().GetRawDataResource( 114 ResourceBundle::GetSharedInstance().GetRawDataResource(
113 resource_id)); 115 resource_id));
114 // "t" is the id of the templates root node. 116 // "t" is the id of the templates root node.
115 return webui::GetTemplatesHtml(template_html, &error_strings, "t"); 117 return webui::GetTemplatesHtml(template_html, &error_strings, "t");
116 } 118 }
117 119
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 163 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
162 DVLOG(1) << "ConnectionTypeObserver notification received: state=" 164 DVLOG(1) << "ConnectionTypeObserver notification received: state="
163 << (online ? "online" : "offline"); 165 << (online ? "online" : "offline");
164 if (online) { 166 if (online) {
165 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 167 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
166 interstitial_page_->Proceed(); 168 interstitial_page_->Proceed();
167 } 169 }
168 } 170 }
169 171
170 } // namespace chromeos 172 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698