| 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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "base/strings/string16.h" | 28 #include "base/strings/string16.h" |
| 29 #include "base/strings/string_number_conversions.h" | 29 #include "base/strings/string_number_conversions.h" |
| 30 #include "base/strings/string_util.h" | 30 #include "base/strings/string_util.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 31 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 33 #include "base/time/time.h" | 33 #include "base/time/time.h" |
| 34 #include "base/trace_event/trace_event.h" | 34 #include "base/trace_event/trace_event.h" |
| 35 #include "build/build_config.h" | 35 #include "build/build_config.h" |
| 36 #include "components/mime_util/mime_util.h" | 36 #include "components/mime_util/mime_util.h" |
| 37 #include "components/rappor/public/rappor_utils.h" | 37 #include "components/rappor/public/rappor_utils.h" |
| 38 #include "components/ukm/public/ukm_recorder.h" |
| 38 #include "components/url_formatter/url_formatter.h" | 39 #include "components/url_formatter/url_formatter.h" |
| 39 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 40 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 40 #include "content/browser/bad_message.h" | 41 #include "content/browser/bad_message.h" |
| 41 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 42 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 42 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 43 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 43 #include "content/browser/child_process_security_policy_impl.h" | 44 #include "content/browser/child_process_security_policy_impl.h" |
| 44 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 45 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 45 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 46 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 46 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 47 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 47 #include "content/browser/download/download_stats.h" | 48 #include "content/browser/download/download_stats.h" |
| (...skipping 5535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5583 dialog_manager_ = dialog_manager; | 5584 dialog_manager_ = dialog_manager; |
| 5584 } | 5585 } |
| 5585 | 5586 |
| 5586 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5587 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5587 auto it = binding_sets_.find(interface_name); | 5588 auto it = binding_sets_.find(interface_name); |
| 5588 if (it != binding_sets_.end()) | 5589 if (it != binding_sets_.end()) |
| 5589 binding_sets_.erase(it); | 5590 binding_sets_.erase(it); |
| 5590 } | 5591 } |
| 5591 | 5592 |
| 5592 bool WebContentsImpl::AddDomainInfoToRapporSample(rappor::Sample* sample) { | 5593 bool WebContentsImpl::AddDomainInfoToRapporSample(rappor::Sample* sample) { |
| 5594 // Here we associate this metric to the main frame URL regardless of what |
| 5595 // caused it. |
| 5593 sample->SetStringField("Domain", ::rappor::GetDomainAndRegistrySampleFromGURL( | 5596 sample->SetStringField("Domain", ::rappor::GetDomainAndRegistrySampleFromGURL( |
| 5594 GetLastCommittedURL())); | 5597 GetLastCommittedURL())); |
| 5598 return true; |
| 5599 } |
| 5595 | 5600 |
| 5596 return true; | 5601 void WebContentsImpl::UpdateUrlForUkmSource(ukm::UkmRecorder* service, |
| 5602 ukm::SourceId ukm_source_id) { |
| 5603 // Here we associate this metric to the main frame URL regardless of what |
| 5604 // caused it. |
| 5605 service->UpdateSourceURL(ukm_source_id, GetLastCommittedURL()); |
| 5597 } | 5606 } |
| 5598 | 5607 |
| 5599 void WebContentsImpl::FocusedNodeTouched(bool editable) { | 5608 void WebContentsImpl::FocusedNodeTouched(bool editable) { |
| 5600 #if defined(OS_WIN) | 5609 #if defined(OS_WIN) |
| 5601 // We use the cursor position to determine where the touch occurred. | 5610 // We use the cursor position to determine where the touch occurred. |
| 5602 RenderWidgetHostView* view = GetRenderWidgetHostView(); | 5611 RenderWidgetHostView* view = GetRenderWidgetHostView(); |
| 5603 if (!view) | 5612 if (!view) |
| 5604 return; | 5613 return; |
| 5605 POINT cursor_pos = {}; | 5614 POINT cursor_pos = {}; |
| 5606 ::GetCursorPos(&cursor_pos); | 5615 ::GetCursorPos(&cursor_pos); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5651 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5660 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5652 if (!render_view_host) | 5661 if (!render_view_host) |
| 5653 continue; | 5662 continue; |
| 5654 render_view_host_set.insert(render_view_host); | 5663 render_view_host_set.insert(render_view_host); |
| 5655 } | 5664 } |
| 5656 for (RenderViewHost* render_view_host : render_view_host_set) | 5665 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5657 render_view_host->OnWebkitPreferencesChanged(); | 5666 render_view_host->OnWebkitPreferencesChanged(); |
| 5658 } | 5667 } |
| 5659 | 5668 |
| 5660 } // namespace content | 5669 } // namespace content |
| OLD | NEW |