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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 | 1114 |
1115 void WebContentsImpl::LostCapture() { | 1115 void WebContentsImpl::LostCapture() { |
1116 if (delegate_) | 1116 if (delegate_) |
1117 delegate_->LostCapture(); | 1117 delegate_->LostCapture(); |
1118 } | 1118 } |
1119 | 1119 |
1120 bool WebContentsImpl::PreHandleKeyboardEvent( | 1120 bool WebContentsImpl::PreHandleKeyboardEvent( |
1121 const NativeWebKeyboardEvent& event, | 1121 const NativeWebKeyboardEvent& event, |
1122 bool* is_keyboard_shortcut) { | 1122 bool* is_keyboard_shortcut) { |
1123 return delegate_ && | 1123 return delegate_ && |
1124 delegate_->PreHandleKeyboardEvent(event, is_keyboard_shortcut); | 1124 delegate_->PreHandleKeyboardEvent(this, event, is_keyboard_shortcut); |
1125 } | 1125 } |
1126 | 1126 |
1127 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 1127 void WebContentsImpl::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
1128 if (delegate_) | 1128 if (delegate_) |
1129 delegate_->HandleKeyboardEvent(event); | 1129 delegate_->HandleKeyboardEvent(this, event); |
1130 } | 1130 } |
1131 | 1131 |
1132 void WebContentsImpl::HandleMouseDown() { | 1132 void WebContentsImpl::HandleMouseDown() { |
1133 if (delegate_) | 1133 if (delegate_) |
1134 delegate_->HandleMouseDown(); | 1134 delegate_->HandleMouseDown(); |
1135 } | 1135 } |
1136 | 1136 |
1137 void WebContentsImpl::HandleMouseUp() { | 1137 void WebContentsImpl::HandleMouseUp() { |
1138 if (delegate_) | 1138 if (delegate_) |
1139 delegate_->HandleMouseUp(); | 1139 delegate_->HandleMouseUp(); |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2678 | 2678 |
2679 void WebContentsImpl::DidCancelLoading() { | 2679 void WebContentsImpl::DidCancelLoading() { |
2680 controller_.DiscardNonCommittedEntries(); | 2680 controller_.DiscardNonCommittedEntries(); |
2681 | 2681 |
2682 // Update the URL display. | 2682 // Update the URL display. |
2683 NotifyNavigationStateChanged(content::INVALIDATE_TYPE_URL); | 2683 NotifyNavigationStateChanged(content::INVALIDATE_TYPE_URL); |
2684 } | 2684 } |
2685 | 2685 |
2686 void WebContentsImpl::DidChangeLoadProgress(double progress) { | 2686 void WebContentsImpl::DidChangeLoadProgress(double progress) { |
2687 if (delegate_) | 2687 if (delegate_) |
2688 delegate_->LoadProgressChanged(progress); | 2688 delegate_->LoadProgressChanged(this, progress); |
2689 } | 2689 } |
2690 | 2690 |
2691 void WebContentsImpl::DocumentAvailableInMainFrame( | 2691 void WebContentsImpl::DocumentAvailableInMainFrame( |
2692 RenderViewHost* render_view_host) { | 2692 RenderViewHost* render_view_host) { |
2693 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2693 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2694 DocumentAvailableInMainFrame()); | 2694 DocumentAvailableInMainFrame()); |
2695 } | 2695 } |
2696 | 2696 |
2697 void WebContentsImpl::DocumentOnLoadCompletedInMainFrame( | 2697 void WebContentsImpl::DocumentOnLoadCompletedInMainFrame( |
2698 RenderViewHost* render_view_host, | 2698 RenderViewHost* render_view_host, |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3154 browser_plugin_host()->embedder_render_process_host(); | 3154 browser_plugin_host()->embedder_render_process_host(); |
3155 *embedder_container_id = browser_plugin_host()->instance_id(); | 3155 *embedder_container_id = browser_plugin_host()->instance_id(); |
3156 int embedder_process_id = | 3156 int embedder_process_id = |
3157 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3157 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3158 if (embedder_process_id != -1) { | 3158 if (embedder_process_id != -1) { |
3159 *embedder_channel_name = | 3159 *embedder_channel_name = |
3160 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3160 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3161 embedder_process_id); | 3161 embedder_process_id); |
3162 } | 3162 } |
3163 } | 3163 } |
OLD | NEW |