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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // browser. But we want to keep the throbber in sync with what's happening | 332 // browser. But we want to keep the throbber in sync with what's happening |
333 // in the UI. For example, we want to start throbbing immediately when the | 333 // in the UI. For example, we want to start throbbing immediately when the |
334 // user naivgates even if the renderer is delayed. There is also an issue | 334 // user naivgates even if the renderer is delayed. There is also an issue |
335 // with the throbber starting because the WebUI (which controls whether the | 335 // with the throbber starting because the WebUI (which controls whether the |
336 // favicon is displayed) happens synchronously. If the start loading | 336 // favicon is displayed) happens synchronously. If the start loading |
337 // messages was asynchronous, then the default favicon would flash in. | 337 // messages was asynchronous, then the default favicon would flash in. |
338 // | 338 // |
339 // WebKit doesn't send throb notifications for JavaScript URLs, so we | 339 // WebKit doesn't send throb notifications for JavaScript URLs, so we |
340 // don't want to either. | 340 // don't want to either. |
341 if (!params.url.SchemeIs(chrome::kJavaScriptScheme)) | 341 if (!params.url.SchemeIs(chrome::kJavaScriptScheme)) |
342 delegate_->DidStartLoading(); | 342 delegate_->DidStartLoading(this); |
343 | 343 |
344 FOR_EACH_OBSERVER(content::RenderViewHostObserver, | 344 FOR_EACH_OBSERVER(content::RenderViewHostObserver, |
345 observers_, Navigate(params.url)); | 345 observers_, Navigate(params.url)); |
346 } | 346 } |
347 | 347 |
348 void RenderViewHostImpl::NavigateToURL(const GURL& url) { | 348 void RenderViewHostImpl::NavigateToURL(const GURL& url) { |
349 ViewMsg_Navigate_Params params; | 349 ViewMsg_Navigate_Params params; |
350 params.page_id = -1; | 350 params.page_id = -1; |
351 params.pending_history_list_offset = -1; | 351 params.pending_history_list_offset = -1; |
352 params.current_history_list_offset = -1; | 352 params.current_history_list_offset = -1; |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 ClosePageIgnoringUnloadEvents(); | 1191 ClosePageIgnoringUnloadEvents(); |
1192 } | 1192 } |
1193 | 1193 |
1194 void RenderViewHostImpl::OnMsgRequestMove(const gfx::Rect& pos) { | 1194 void RenderViewHostImpl::OnMsgRequestMove(const gfx::Rect& pos) { |
1195 if (!is_swapped_out_) | 1195 if (!is_swapped_out_) |
1196 delegate_->RequestMove(pos); | 1196 delegate_->RequestMove(pos); |
1197 Send(new ViewMsg_Move_ACK(GetRoutingID())); | 1197 Send(new ViewMsg_Move_ACK(GetRoutingID())); |
1198 } | 1198 } |
1199 | 1199 |
1200 void RenderViewHostImpl::OnMsgDidStartLoading() { | 1200 void RenderViewHostImpl::OnMsgDidStartLoading() { |
1201 delegate_->DidStartLoading(); | 1201 delegate_->DidStartLoading(this); |
1202 } | 1202 } |
1203 | 1203 |
1204 void RenderViewHostImpl::OnMsgDidStopLoading() { | 1204 void RenderViewHostImpl::OnMsgDidStopLoading() { |
1205 delegate_->DidStopLoading(); | 1205 delegate_->DidStopLoading(this); |
1206 } | 1206 } |
1207 | 1207 |
1208 void RenderViewHostImpl::OnMsgDidChangeLoadProgress(double load_progress) { | 1208 void RenderViewHostImpl::OnMsgDidChangeLoadProgress(double load_progress) { |
1209 delegate_->DidChangeLoadProgress(load_progress); | 1209 delegate_->DidChangeLoadProgress(load_progress); |
1210 } | 1210 } |
1211 | 1211 |
1212 void RenderViewHostImpl::OnMsgDocumentAvailableInMainFrame() { | 1212 void RenderViewHostImpl::OnMsgDocumentAvailableInMainFrame() { |
1213 delegate_->DocumentAvailableInMainFrame(this); | 1213 delegate_->DocumentAvailableInMainFrame(this); |
1214 } | 1214 } |
1215 | 1215 |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 // can cause navigations to be ignored in OnMsgNavigate. | 1874 // can cause navigations to be ignored in OnMsgNavigate. |
1875 is_waiting_for_beforeunload_ack_ = false; | 1875 is_waiting_for_beforeunload_ack_ = false; |
1876 is_waiting_for_unload_ack_ = false; | 1876 is_waiting_for_unload_ack_ = false; |
1877 } | 1877 } |
1878 | 1878 |
1879 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1879 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1880 STLDeleteValues(&power_save_blockers_); | 1880 STLDeleteValues(&power_save_blockers_); |
1881 } | 1881 } |
1882 | 1882 |
1883 } // namespace content | 1883 } // namespace content |
OLD | NEW |