OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 delegate()->WebIntentDispatch(this, message.routing_id(), intent, intent_id); | 1143 delegate()->WebIntentDispatch(this, message.routing_id(), intent, intent_id); |
1144 } | 1144 } |
1145 | 1145 |
1146 void TabContents::OnFindReply(int request_id, | 1146 void TabContents::OnFindReply(int request_id, |
1147 int number_of_matches, | 1147 int number_of_matches, |
1148 const gfx::Rect& selection_rect, | 1148 const gfx::Rect& selection_rect, |
1149 int active_match_ordinal, | 1149 int active_match_ordinal, |
1150 bool final_update) { | 1150 bool final_update) { |
1151 delegate()->FindReply(this, request_id, number_of_matches, selection_rect, | 1151 delegate()->FindReply(this, request_id, number_of_matches, selection_rect, |
1152 active_match_ordinal, final_update); | 1152 active_match_ordinal, final_update); |
| 1153 // Send a notification to the renderer that we are ready to receive more |
| 1154 // results from the scoping effort of the Find operation. The FindInPage |
| 1155 // scoping is asynchronous and periodically sends results back up to the |
| 1156 // browser using IPC. In an effort to not spam the browser we have the |
| 1157 // browser send an ACK for each FindReply message and have the renderer |
| 1158 // queue up the latest status message while waiting for this ACK. |
| 1159 render_view_host()->Send( |
| 1160 new ViewMsg_FindReplyACK(render_view_host()->routing_id())); |
1153 } | 1161 } |
1154 | 1162 |
1155 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { | 1163 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { |
1156 delegate()->CrashedPlugin(this, plugin_path); | 1164 delegate()->CrashedPlugin(this, plugin_path); |
1157 } | 1165 } |
1158 | 1166 |
1159 void TabContents::OnAppCacheAccessed(const GURL& manifest_url, | 1167 void TabContents::OnAppCacheAccessed(const GURL& manifest_url, |
1160 bool blocked_by_policy) { | 1168 bool blocked_by_policy) { |
1161 // Notify observers about navigation. | 1169 // Notify observers about navigation. |
1162 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 1170 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 } | 2023 } |
2016 | 2024 |
2017 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 2025 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
2018 render_manager_.SwapInRenderViewHost(rvh); | 2026 render_manager_.SwapInRenderViewHost(rvh); |
2019 } | 2027 } |
2020 | 2028 |
2021 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2029 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2022 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2030 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2023 rwh_view->SetSize(view()->GetContainerSize()); | 2031 rwh_view->SetSize(view()->GetContainerSize()); |
2024 } | 2032 } |
OLD | NEW |