| OLD | NEW |
| 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/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 | 375 |
| 376 void ChromeRenderViewObserver::CapturePageInfo(bool preliminary_capture) { | 376 void ChromeRenderViewObserver::CapturePageInfo(bool preliminary_capture) { |
| 377 if (!render_view()->GetWebView()) | 377 if (!render_view()->GetWebView()) |
| 378 return; | 378 return; |
| 379 | 379 |
| 380 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); | 380 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); |
| 381 if (!main_frame) | 381 if (!main_frame) |
| 382 return; | 382 return; |
| 383 | 383 |
| 384 // TODO(creis): Refactor WebFrame::contentAsText to handle RemoteFrames, |
| 385 // likely by moving it to the browser process. For now, only capture page |
| 386 // info from main frames that are LocalFrames, and ignore their RemoteFrame |
| 387 // children. |
| 388 if (main_frame->isWebRemoteFrame()) |
| 389 return; |
| 390 |
| 384 // Don't index/capture pages that are in view source mode. | 391 // Don't index/capture pages that are in view source mode. |
| 385 if (main_frame->isViewSourceModeEnabled()) | 392 if (main_frame->isViewSourceModeEnabled()) |
| 386 return; | 393 return; |
| 387 | 394 |
| 388 // Don't index/capture pages that failed to load. This only checks the top | 395 // Don't index/capture pages that failed to load. This only checks the top |
| 389 // level frame so the thumbnail may contain a frame that failed to load. | 396 // level frame so the thumbnail may contain a frame that failed to load. |
| 390 WebDataSource* ds = main_frame->dataSource(); | 397 WebDataSource* ds = main_frame->dataSource(); |
| 391 if (ds && ds->hasUnreachableURL()) | 398 if (ds && ds->hasUnreachableURL()) |
| 392 return; | 399 return; |
| 393 | 400 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 WebElement element = node.to<WebElement>(); | 472 WebElement element = node.to<WebElement>(); |
| 466 if (!element.hasHTMLTagName(tag_name)) | 473 if (!element.hasHTMLTagName(tag_name)) |
| 467 continue; | 474 continue; |
| 468 WebString value = element.getAttribute(attribute_name); | 475 WebString value = element.getAttribute(attribute_name); |
| 469 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 476 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
| 470 continue; | 477 continue; |
| 471 return true; | 478 return true; |
| 472 } | 479 } |
| 473 return false; | 480 return false; |
| 474 } | 481 } |
| OLD | NEW |