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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 #include "content/common/ssl_status_serialization.h" | 50 #include "content/common/ssl_status_serialization.h" |
51 #include "content/common/view_messages.h" | 51 #include "content/common/view_messages.h" |
52 #include "content/public/common/bindings_policy.h" | 52 #include "content/public/common/bindings_policy.h" |
53 #include "content/public/common/content_client.h" | 53 #include "content/public/common/content_client.h" |
54 #include "content/public/common/content_constants.h" | 54 #include "content/public/common/content_constants.h" |
55 #include "content/public/common/content_switches.h" | 55 #include "content/public/common/content_switches.h" |
56 #include "content/public/common/drop_data.h" | 56 #include "content/public/common/drop_data.h" |
57 #include "content/public/common/favicon_url.h" | 57 #include "content/public/common/favicon_url.h" |
58 #include "content/public/common/file_chooser_file_info.h" | 58 #include "content/public/common/file_chooser_file_info.h" |
59 #include "content/public/common/file_chooser_params.h" | 59 #include "content/public/common/file_chooser_params.h" |
60 #include "content/public/common/page_importance_signals.h" | |
60 #include "content/public/common/page_state.h" | 61 #include "content/public/common/page_state.h" |
61 #include "content/public/common/page_zoom.h" | 62 #include "content/public/common/page_zoom.h" |
62 #include "content/public/common/ssl_status.h" | 63 #include "content/public/common/ssl_status.h" |
63 #include "content/public/common/three_d_api_types.h" | 64 #include "content/public/common/three_d_api_types.h" |
64 #include "content/public/common/url_constants.h" | 65 #include "content/public/common/url_constants.h" |
65 #include "content/public/common/url_utils.h" | 66 #include "content/public/common/url_utils.h" |
66 #include "content/public/common/web_preferences.h" | 67 #include "content/public/common/web_preferences.h" |
67 #include "content/public/renderer/content_renderer_client.h" | 68 #include "content/public/renderer/content_renderer_client.h" |
68 #include "content/public/renderer/document_state.h" | 69 #include "content/public/renderer/document_state.h" |
69 #include "content/public/renderer/navigation_state.h" | 70 #include "content/public/renderer/navigation_state.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 #include "third_party/WebKit/public/web/WebGlyphCache.h" | 145 #include "third_party/WebKit/public/web/WebGlyphCache.h" |
145 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 146 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
146 #include "third_party/WebKit/public/web/WebHitTestResult.h" | 147 #include "third_party/WebKit/public/web/WebHitTestResult.h" |
147 #include "third_party/WebKit/public/web/WebInputElement.h" | 148 #include "third_party/WebKit/public/web/WebInputElement.h" |
148 #include "third_party/WebKit/public/web/WebInputEvent.h" | 149 #include "third_party/WebKit/public/web/WebInputEvent.h" |
149 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 150 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
150 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h" | 151 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h" |
151 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 152 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
152 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 153 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
153 #include "third_party/WebKit/public/web/WebNodeList.h" | 154 #include "third_party/WebKit/public/web/WebNodeList.h" |
155 #include "third_party/WebKit/public/web/WebPageImportanceSignals.h" | |
154 #include "third_party/WebKit/public/web/WebPageSerializer.h" | 156 #include "third_party/WebKit/public/web/WebPageSerializer.h" |
155 #include "third_party/WebKit/public/web/WebPlugin.h" | 157 #include "third_party/WebKit/public/web/WebPlugin.h" |
156 #include "third_party/WebKit/public/web/WebPluginAction.h" | 158 #include "third_party/WebKit/public/web/WebPluginAction.h" |
157 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 159 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
158 #include "third_party/WebKit/public/web/WebPluginDocument.h" | 160 #include "third_party/WebKit/public/web/WebPluginDocument.h" |
159 #include "third_party/WebKit/public/web/WebRange.h" | 161 #include "third_party/WebKit/public/web/WebRange.h" |
160 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 162 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
161 #include "third_party/WebKit/public/web/WebScriptSource.h" | 163 #include "third_party/WebKit/public/web/WebScriptSource.h" |
162 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 164 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
163 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 165 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
(...skipping 3348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3512 return current_state; | 3514 return current_state; |
3513 } | 3515 } |
3514 | 3516 |
3515 void RenderViewImpl::draggableRegionsChanged() { | 3517 void RenderViewImpl::draggableRegionsChanged() { |
3516 FOR_EACH_OBSERVER( | 3518 FOR_EACH_OBSERVER( |
3517 RenderViewObserver, | 3519 RenderViewObserver, |
3518 observers_, | 3520 observers_, |
3519 DraggableRegionsChanged(webview()->mainFrame())); | 3521 DraggableRegionsChanged(webview()->mainFrame())); |
3520 } | 3522 } |
3521 | 3523 |
3524 void RenderViewImpl::pageImportanceSignalsChanged() { | |
3525 if (!webview()) | |
kinuko
2015/09/24 00:26:22
nit: Could this happen when this is signaled?
kouhei (in TOK)
2015/09/24 01:13:46
Yes. This can happen when the view is closing.
| |
3526 return; | |
3527 | |
3528 blink::WebPageImportanceSignals* web_signals = | |
3529 webview()->pageImportanceSignals(); | |
3530 if (!web_signals) | |
kinuko
2015/09/24 00:26:23
ditto
kouhei (in TOK)
2015/09/24 01:13:46
web_signals is guaranteed to be non-null now. Fixe
| |
3531 return; | |
3532 | |
3533 PageImportanceSignals signals; | |
3534 signals.had_form_interaction = web_signals->hadFormInteraction(); | |
3535 | |
3536 main_render_frame_->Send(new FrameHostMsg_UpdatePageImportanceSignals( | |
3537 main_render_frame_->GetRoutingID(), signals)); | |
3538 } | |
3539 | |
3522 #if defined(OS_ANDROID) | 3540 #if defined(OS_ANDROID) |
3523 WebContentDetectionResult RenderViewImpl::detectContentAround( | 3541 WebContentDetectionResult RenderViewImpl::detectContentAround( |
3524 const WebHitTestResult& touch_hit) { | 3542 const WebHitTestResult& touch_hit) { |
3525 DCHECK(touch_hit.node().isTextNode()); | 3543 DCHECK(touch_hit.node().isTextNode()); |
3526 | 3544 |
3527 // Process the position with all the registered content detectors until | 3545 // Process the position with all the registered content detectors until |
3528 // a match is found. Priority is provided by their relative order. | 3546 // a match is found. Priority is provided by their relative order. |
3529 for (ContentDetectorList::const_iterator it = content_detectors_.begin(); | 3547 for (ContentDetectorList::const_iterator it = content_detectors_.begin(); |
3530 it != content_detectors_.end(); ++it) { | 3548 it != content_detectors_.end(); ++it) { |
3531 ContentDetector::Result content = (*it)->FindTappedContent(touch_hit); | 3549 ContentDetector::Result content = (*it)->FindTappedContent(touch_hit); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3785 std::vector<gfx::Size> sizes; | 3803 std::vector<gfx::Size> sizes; |
3786 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3804 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3787 if (!url.isEmpty()) | 3805 if (!url.isEmpty()) |
3788 urls.push_back( | 3806 urls.push_back( |
3789 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3807 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3790 } | 3808 } |
3791 SendUpdateFaviconURL(urls); | 3809 SendUpdateFaviconURL(urls); |
3792 } | 3810 } |
3793 | 3811 |
3794 } // namespace content | 3812 } // namespace content |
OLD | NEW |