OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/net/net_error_helper.h" | 5 #include "chrome/renderer/net/net_error_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 error.unreachableURL, is_failed_post, | 190 error.unreachableURL, is_failed_post, |
191 (load_stale_cache_enabled && | 191 (load_stale_cache_enabled && |
192 error.staleCopyInCache && !is_failed_post), | 192 error.staleCopyInCache && !is_failed_post), |
193 RenderThread::Get()->GetLocale(), | 193 RenderThread::Get()->GetLocale(), |
194 render_frame()->GetRenderView()-> | 194 render_frame()->GetRenderView()-> |
195 GetAcceptLanguages(), | 195 GetAcceptLanguages(), |
196 params.Pass(), &error_strings); | 196 params.Pass(), &error_strings); |
197 *reload_button_shown = error_strings.Get("reloadButton", NULL); | 197 *reload_button_shown = error_strings.Get("reloadButton", NULL); |
198 *load_stale_button_shown = error_strings.Get("staleLoadButton", NULL); | 198 *load_stale_button_shown = error_strings.Get("staleLoadButton", NULL); |
199 | 199 |
| 200 #if defined(OS_CHROMEOS) |
| 201 // Check if easter egg should be disabled. |
| 202 if (command_line->HasSwitch(switches::kDisableDinosaurEasterEgg)) { |
| 203 error_strings.SetString("disableEasterEgg", "1"); |
| 204 } |
| 205 #endif |
| 206 |
200 // "t" is the id of the template's root node. | 207 // "t" is the id of the template's root node. |
201 *error_html = webui::GetTemplatesHtml(template_html, &error_strings, "t"); | 208 *error_html = webui::GetTemplatesHtml(template_html, &error_strings, "t"); |
202 } | 209 } |
203 } | 210 } |
204 | 211 |
205 void NetErrorHelper::LoadErrorPageInMainFrame(const std::string& html, | 212 void NetErrorHelper::LoadErrorPageInMainFrame(const std::string& html, |
206 const GURL& failed_url) { | 213 const GURL& failed_url) { |
207 blink::WebView* web_view = render_frame()->GetRenderView()->GetWebView(); | 214 blink::WebView* web_view = render_frame()->GetRenderView()->GetWebView(); |
208 if (!web_view) | 215 if (!web_view) |
209 return; | 216 return; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 success ? data : "", | 354 success ? data : "", |
348 render_frame()->GetRenderView()->GetAcceptLanguages(), | 355 render_frame()->GetRenderView()->GetAcceptLanguages(), |
349 base::i18n::IsRTL()); | 356 base::i18n::IsRTL()); |
350 } | 357 } |
351 | 358 |
352 void NetErrorHelper::OnTrackingRequestComplete( | 359 void NetErrorHelper::OnTrackingRequestComplete( |
353 const blink::WebURLResponse& response, | 360 const blink::WebURLResponse& response, |
354 const std::string& data) { | 361 const std::string& data) { |
355 tracking_fetcher_.reset(); | 362 tracking_fetcher_.reset(); |
356 } | 363 } |
OLD | NEW |