| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 search_provider::AUTODETECTED_PROVIDER)); | 341 search_provider::AUTODETECTED_PROVIDER)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 // Don't capture pages including refresh meta tag. | 344 // Don't capture pages including refresh meta tag. |
| 345 if (HasRefreshMetaTag(main_frame)) | 345 if (HasRefreshMetaTag(main_frame)) |
| 346 return; | 346 return; |
| 347 | 347 |
| 348 CapturePageInfoLater( | 348 CapturePageInfoLater( |
| 349 false, // preliminary_capture | 349 false, // preliminary_capture |
| 350 base::TimeDelta::FromMilliseconds( | 350 base::TimeDelta::FromMilliseconds( |
| 351 render_view()->IsPageStateSentImmediately() ? | 351 render_view()->GetContentStateImmediately() ? |
| 352 0 : kDelayForCaptureMs)); | 352 0 : kDelayForCaptureMs)); |
| 353 } | 353 } |
| 354 | 354 |
| 355 void ChromeRenderViewObserver::DidCommitProvisionalLoad( | 355 void ChromeRenderViewObserver::DidCommitProvisionalLoad( |
| 356 WebLocalFrame* frame, bool is_new_navigation) { | 356 WebLocalFrame* frame, bool is_new_navigation) { |
| 357 // Don't capture pages being not new, or including refresh meta tag. | 357 // Don't capture pages being not new, or including refresh meta tag. |
| 358 if (!is_new_navigation || HasRefreshMetaTag(frame)) | 358 if (!is_new_navigation || HasRefreshMetaTag(frame)) |
| 359 return; | 359 return; |
| 360 | 360 |
| 361 CapturePageInfoLater( | 361 CapturePageInfoLater( |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 WebElement element = node.to<WebElement>(); | 472 WebElement element = node.to<WebElement>(); |
| 473 if (!element.hasHTMLTagName(tag_name)) | 473 if (!element.hasHTMLTagName(tag_name)) |
| 474 continue; | 474 continue; |
| 475 WebString value = element.getAttribute(attribute_name); | 475 WebString value = element.getAttribute(attribute_name); |
| 476 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 476 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
| 477 continue; | 477 continue; |
| 478 return true; | 478 return true; |
| 479 } | 479 } |
| 480 return false; | 480 return false; |
| 481 } | 481 } |
| OLD | NEW |