| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 DCHECK(!suspended_nav_params_.get()); | 325 DCHECK(!suspended_nav_params_.get()); |
| 326 suspended_nav_params_.reset(new ViewMsg_Navigate_Params(params)); | 326 suspended_nav_params_.reset(new ViewMsg_Navigate_Params(params)); |
| 327 } else { | 327 } else { |
| 328 // Get back to a clean state, in case we start a new navigation without | 328 // Get back to a clean state, in case we start a new navigation without |
| 329 // completing a RVH swap or unload handler. | 329 // completing a RVH swap or unload handler. |
| 330 SetSwappedOut(false); | 330 SetSwappedOut(false); |
| 331 | 331 |
| 332 Send(new ViewMsg_Navigate(GetRoutingID(), params)); | 332 Send(new ViewMsg_Navigate(GetRoutingID(), params)); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // Force the throbber to start. We do this because WebKit's "started | |
| 336 // loading" message will be received asynchronously from the UI of the | |
| 337 // browser. But we want to keep the throbber in sync with what's happening | |
| 338 // in the UI. For example, we want to start throbbing immediately when the | |
| 339 // user naivgates even if the renderer is delayed. There is also an issue | |
| 340 // with the throbber starting because the WebUI (which controls whether the | |
| 341 // favicon is displayed) happens synchronously. If the start loading | |
| 342 // messages was asynchronous, then the default favicon would flash in. | |
| 343 // | |
| 344 // WebKit doesn't send throb notifications for JavaScript URLs, so we | |
| 345 // don't want to either. | |
| 346 if (!params.url.SchemeIs(kJavaScriptScheme)) | |
| 347 delegate_->DidStartLoading(this); | |
| 348 | |
| 349 FOR_EACH_OBSERVER(RenderViewHostObserver, observers_, Navigate(params.url)); | 335 FOR_EACH_OBSERVER(RenderViewHostObserver, observers_, Navigate(params.url)); |
| 350 } | 336 } |
| 351 | 337 |
| 352 void RenderViewHostImpl::NavigateToURL(const GURL& url) { | 338 void RenderViewHostImpl::NavigateToURL(const GURL& url) { |
| 353 ViewMsg_Navigate_Params params; | 339 ViewMsg_Navigate_Params params; |
| 354 params.page_id = -1; | 340 params.page_id = -1; |
| 355 params.pending_history_list_offset = -1; | 341 params.pending_history_list_offset = -1; |
| 356 params.current_history_list_offset = -1; | 342 params.current_history_list_offset = -1; |
| 357 params.current_history_list_length = 0; | 343 params.current_history_list_length = 0; |
| 358 params.url = url; | 344 params.url = url; |
| (...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 2048 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
| 2063 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2049 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
| 2064 file != file_paths.end(); ++file) { | 2050 file != file_paths.end(); ++file) { |
| 2065 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2051 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
| 2066 return false; | 2052 return false; |
| 2067 } | 2053 } |
| 2068 return true; | 2054 return true; |
| 2069 } | 2055 } |
| 2070 | 2056 |
| 2071 } // namespace content | 2057 } // namespace content |
| OLD | NEW |