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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "v8/include/v8-testing.h" | 54 #include "v8/include/v8-testing.h" |
55 | 55 |
56 using blink::WebAXObject; | 56 using blink::WebAXObject; |
57 using blink::WebCString; | 57 using blink::WebCString; |
58 using blink::WebDataSource; | 58 using blink::WebDataSource; |
59 using blink::WebDocument; | 59 using blink::WebDocument; |
60 using blink::WebElement; | 60 using blink::WebElement; |
61 using blink::WebFrame; | 61 using blink::WebFrame; |
62 using blink::WebGestureEvent; | 62 using blink::WebGestureEvent; |
63 using blink::WebIconURL; | 63 using blink::WebIconURL; |
| 64 using blink::WebLocalFrame; |
64 using blink::WebNode; | 65 using blink::WebNode; |
65 using blink::WebNodeList; | 66 using blink::WebNodeList; |
66 using blink::WebRect; | 67 using blink::WebRect; |
67 using blink::WebSecurityOrigin; | 68 using blink::WebSecurityOrigin; |
68 using blink::WebSize; | 69 using blink::WebSize; |
69 using blink::WebString; | 70 using blink::WebString; |
70 using blink::WebTouchEvent; | 71 using blink::WebTouchEvent; |
71 using blink::WebURL; | 72 using blink::WebURL; |
72 using blink::WebURLRequest; | 73 using blink::WebURLRequest; |
73 using blink::WebView; | 74 using blink::WebView; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 402 |
402 CapturePageInfoLater( | 403 CapturePageInfoLater( |
403 render_view()->GetPageId(), | 404 render_view()->GetPageId(), |
404 false, // preliminary_capture | 405 false, // preliminary_capture |
405 base::TimeDelta::FromMilliseconds( | 406 base::TimeDelta::FromMilliseconds( |
406 render_view()->GetContentStateImmediately() ? | 407 render_view()->GetContentStateImmediately() ? |
407 0 : kDelayForCaptureMs)); | 408 0 : kDelayForCaptureMs)); |
408 } | 409 } |
409 | 410 |
410 void ChromeRenderViewObserver::DidCommitProvisionalLoad( | 411 void ChromeRenderViewObserver::DidCommitProvisionalLoad( |
411 WebFrame* frame, bool is_new_navigation) { | 412 WebLocalFrame* frame, bool is_new_navigation) { |
412 // Don't capture pages being not new, or including refresh meta tag. | 413 // Don't capture pages being not new, or including refresh meta tag. |
413 if (!is_new_navigation || HasRefreshMetaTag(frame)) | 414 if (!is_new_navigation || HasRefreshMetaTag(frame)) |
414 return; | 415 return; |
415 | 416 |
416 CapturePageInfoLater( | 417 CapturePageInfoLater( |
417 render_view()->GetPageId(), | 418 render_view()->GetPageId(), |
418 true, // preliminary_capture | 419 true, // preliminary_capture |
419 base::TimeDelta::FromMilliseconds(kDelayForForcedCaptureMs)); | 420 base::TimeDelta::FromMilliseconds(kDelayForForcedCaptureMs)); |
420 } | 421 } |
421 | 422 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 WebElement element = node.to<WebElement>(); | 582 WebElement element = node.to<WebElement>(); |
582 if (!element.hasTagName(tag_name)) | 583 if (!element.hasTagName(tag_name)) |
583 continue; | 584 continue; |
584 WebString value = element.getAttribute(attribute_name); | 585 WebString value = element.getAttribute(attribute_name); |
585 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 586 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
586 continue; | 587 continue; |
587 return true; | 588 return true; |
588 } | 589 } |
589 return false; | 590 return false; |
590 } | 591 } |
OLD | NEW |