OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/global_request_id.h" | 29 #include "content/public/browser/global_request_id.h" |
30 #include "content/public/browser/invalidate_type.h" | 30 #include "content/public/browser/invalidate_type.h" |
31 #include "content/public/browser/navigation_controller.h" | 31 #include "content/public/browser/navigation_controller.h" |
32 #include "content/public/browser/navigation_details.h" | 32 #include "content/public/browser/navigation_details.h" |
33 #include "content/public/browser/page_navigator.h" | 33 #include "content/public/browser/page_navigator.h" |
34 #include "content/public/browser/render_view_host.h" | 34 #include "content/public/browser/render_view_host.h" |
35 #include "content/public/browser/stream_handle.h" | 35 #include "content/public/browser/stream_handle.h" |
36 #include "content/public/browser/user_metrics.h" | 36 #include "content/public/browser/user_metrics.h" |
37 #include "content/public/common/bindings_policy.h" | 37 #include "content/public/common/bindings_policy.h" |
38 #include "content/public/common/content_client.h" | 38 #include "content/public/common/content_client.h" |
| 39 #include "content/public/common/content_constants.h" |
39 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
40 #include "content/public/common/resource_response.h" | 41 #include "content/public/common/resource_response.h" |
41 #include "content/public/common/url_constants.h" | 42 #include "content/public/common/url_constants.h" |
42 #include "content/public/common/url_utils.h" | |
43 #include "net/base/net_errors.h" | 43 #include "net/base/net_errors.h" |
44 | 44 |
45 namespace content { | 45 namespace content { |
46 | 46 |
47 namespace { | 47 namespace { |
48 | 48 |
49 FrameMsg_Navigate_Type::Value GetNavigationType( | 49 FrameMsg_Navigate_Type::Value GetNavigationType( |
50 BrowserContext* browser_context, const NavigationEntryImpl& entry, | 50 BrowserContext* browser_context, const NavigationEntryImpl& entry, |
51 NavigationController::ReloadType reload_type) { | 51 NavigationController::ReloadType reload_type) { |
52 switch (reload_type) { | 52 switch (reload_type) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 274 |
275 // Don't attempt to navigate to non-empty invalid URLs. | 275 // Don't attempt to navigate to non-empty invalid URLs. |
276 if (!dest_url.is_valid() && !dest_url.is_empty()) { | 276 if (!dest_url.is_valid() && !dest_url.is_empty()) { |
277 LOG(WARNING) << "Refusing to load invalid URL: " | 277 LOG(WARNING) << "Refusing to load invalid URL: " |
278 << dest_url.possibly_invalid_spec(); | 278 << dest_url.possibly_invalid_spec(); |
279 return false; | 279 return false; |
280 } | 280 } |
281 | 281 |
282 // The renderer will reject IPC messages with URLs longer than | 282 // The renderer will reject IPC messages with URLs longer than |
283 // this limit, so don't attempt to navigate with a longer URL. | 283 // this limit, so don't attempt to navigate with a longer URL. |
284 if (dest_url.spec().size() > GetMaxURLChars()) { | 284 if (dest_url.spec().size() > kMaxURLChars) { |
285 LOG(WARNING) << "Refusing to load URL as it exceeds " << GetMaxURLChars() | 285 LOG(WARNING) << "Refusing to load URL as it exceeds " << kMaxURLChars |
286 << " characters."; | 286 << " characters."; |
287 return false; | 287 return false; |
288 } | 288 } |
289 | 289 |
290 // This will be used to set the Navigation Timing API navigationStart | 290 // This will be used to set the Navigation Timing API navigationStart |
291 // parameter for browser navigations in new tabs (intents, tabs opened through | 291 // parameter for browser navigations in new tabs (intents, tabs opened through |
292 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to | 292 // "Open link in new tab"). We need to keep it above RFHM::Navigate() call to |
293 // capture the time needed for the RenderFrameHost initialization. | 293 // capture the time needed for the RenderFrameHost initialization. |
294 base::TimeTicks navigation_start = base::TimeTicks::Now(); | 294 base::TimeTicks navigation_start = base::TimeTicks::Now(); |
295 | 295 |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 984 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
985 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 985 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
986 } | 986 } |
987 controller_->SetPendingEntry(entry.Pass()); | 987 controller_->SetPendingEntry(entry.Pass()); |
988 if (delegate_) | 988 if (delegate_) |
989 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 989 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
990 } | 990 } |
991 } | 991 } |
992 | 992 |
993 } // namespace content | 993 } // namespace content |
OLD | NEW |