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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 webui_javascript_->notify_result); | 658 webui_javascript_->notify_result); |
659 webui_javascript_.reset(); | 659 webui_javascript_.reset(); |
660 } | 660 } |
661 } | 661 } |
662 | 662 |
663 void ChromeRenderViewObserver::DidStopLoading() { | 663 void ChromeRenderViewObserver::DidStopLoading() { |
664 MessageLoop::current()->PostDelayedTask( | 664 MessageLoop::current()->PostDelayedTask( |
665 FROM_HERE, | 665 FROM_HERE, |
666 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, | 666 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, |
667 weak_factory_.GetWeakPtr(), render_view()->GetPageId(), false), | 667 weak_factory_.GetWeakPtr(), render_view()->GetPageId(), false), |
668 base::TimeDelta::FromMilliseconds( | 668 render_view()->GetContentStateImmediately() ? 0 : kDelayForCaptureMs); |
669 render_view()->GetContentStateImmediately() ? | |
670 0 : kDelayForCaptureMs)); | |
671 | 669 |
672 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); | 670 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); |
673 GURL osd_url = main_frame->document().openSearchDescriptionURL(); | 671 GURL osd_url = main_frame->document().openSearchDescriptionURL(); |
674 if (!osd_url.is_empty()) { | 672 if (!osd_url.is_empty()) { |
675 Send(new ChromeViewHostMsg_PageHasOSDD( | 673 Send(new ChromeViewHostMsg_PageHasOSDD( |
676 routing_id(), render_view()->GetPageId(), osd_url, | 674 routing_id(), render_view()->GetPageId(), osd_url, |
677 search_provider::AUTODETECTED_PROVIDER)); | 675 search_provider::AUTODETECTED_PROVIDER)); |
678 } | 676 } |
679 | 677 |
680 int icon_types = WebIconURL::TypeFavicon; | 678 int icon_types = WebIconURL::TypeFavicon; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 | 714 |
717 void ChromeRenderViewObserver::DidCommitProvisionalLoad( | 715 void ChromeRenderViewObserver::DidCommitProvisionalLoad( |
718 WebFrame* frame, bool is_new_navigation) { | 716 WebFrame* frame, bool is_new_navigation) { |
719 if (!is_new_navigation) | 717 if (!is_new_navigation) |
720 return; | 718 return; |
721 | 719 |
722 MessageLoop::current()->PostDelayedTask( | 720 MessageLoop::current()->PostDelayedTask( |
723 FROM_HERE, | 721 FROM_HERE, |
724 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, | 722 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, |
725 weak_factory_.GetWeakPtr(), render_view()->GetPageId(), true), | 723 weak_factory_.GetWeakPtr(), render_view()->GetPageId(), true), |
726 base::TimeDelta::FromMilliseconds(kDelayForForcedCaptureMs)); | 724 kDelayForForcedCaptureMs); |
727 } | 725 } |
728 | 726 |
729 void ChromeRenderViewObserver::DidClearWindowObject(WebFrame* frame) { | 727 void ChromeRenderViewObserver::DidClearWindowObject(WebFrame* frame) { |
730 if (render_view()->GetEnabledBindings() & | 728 if (render_view()->GetEnabledBindings() & |
731 content::BINDINGS_POLICY_DOM_AUTOMATION) { | 729 content::BINDINGS_POLICY_DOM_AUTOMATION) { |
732 BindDOMAutomationController(frame); | 730 BindDOMAutomationController(frame); |
733 } | 731 } |
734 | 732 |
735 if (render_view()->GetEnabledBindings() & | 733 if (render_view()->GetEnabledBindings() & |
736 content::BINDINGS_POLICY_EXTERNAL_HOST) { | 734 content::BINDINGS_POLICY_EXTERNAL_HOST) { |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 reinterpret_cast<const unsigned char*>(&data[0]); | 1075 reinterpret_cast<const unsigned char*>(&data[0]); |
1078 | 1076 |
1079 return decoder.Decode(src_data, data.size()); | 1077 return decoder.Decode(src_data, data.size()); |
1080 } | 1078 } |
1081 return SkBitmap(); | 1079 return SkBitmap(); |
1082 } | 1080 } |
1083 | 1081 |
1084 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1082 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
1085 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1083 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
1086 } | 1084 } |
OLD | NEW |