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

Side by Side Diff: webkit/glue/webframeloaderclient_impl.cc

Issue 159575: Move alternate error page loading out of WebFrame.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webframeloaderclient_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "config.h" 5 #include "config.h"
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // If trying to view source on a 404 page, just show the original page 376 // If trying to view source on a 404 page, just show the original page
377 // content. 377 // content.
378 if (webframe_->frame()->inViewSourceMode()) 378 if (webframe_->frame()->inViewSourceMode())
379 return GURL(); 379 return GURL();
380 380
381 // Construct the URL to fetch from the alt error page server. "html404" 381 // Construct the URL to fetch from the alt error page server. "html404"
382 // is understood by the link doctor server. 382 // is understood by the link doctor server.
383 return d->GetAlternateErrorPageURL(failedURL, WebViewDelegate::HTTP_404); 383 return d->GetAlternateErrorPageURL(failedURL, WebViewDelegate::HTTP_404);
384 } 384 }
385 385
386 void WebFrameLoaderClient::Alt404PageFinished(const GURL& unreachable_url, 386 void WebFrameLoaderClient::Alt404PageFinished(WebFrame* frame,
387 const GURL& unreachable_url,
387 const std::string& html) { 388 const std::string& html) {
388 // TODO(darin): Move this processing out to the embedder. 389 // TODO(darin): Move this processing out to the embedder.
389 if (!html.empty()) { 390 if (!html.empty()) {
390 // TODO(tc): Handle backoff on so we don't hammer the alt error page 391 // TODO(tc): Handle backoff on so we don't hammer the alt error page
391 // servers. 392 // servers.
392 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); 393 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate();
393 if (!d) 394 if (!d)
394 return; 395 return;
395 WebURLError error; 396 WebURLError error;
396 error.unreachableURL = unreachable_url; 397 error.unreachableURL = unreachable_url;
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 1536
1536 std::string offset_str = url.ExtractFileName(); 1537 std::string offset_str = url.ExtractFileName();
1537 int offset; 1538 int offset;
1538 if (!StringToInt(offset_str, &offset)) 1539 if (!StringToInt(offset_str, &offset))
1539 return; 1540 return;
1540 1541
1541 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); 1542 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate();
1542 if (d) 1543 if (d)
1543 d->NavigateBackForwardSoon(offset); 1544 d->NavigateBackForwardSoon(offset);
1544 } 1545 }
OLDNEW
« no previous file with comments | « webkit/glue/webframeloaderclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698