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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // edit the URL and try again. This may be useful in cases that the committed | 220 // edit the URL and try again. This may be useful in cases that the committed |
221 // page cannot be attacker-controlled. In these cases, we still allow the | 221 // page cannot be attacker-controlled. In these cases, we still allow the |
222 // view to clear the pending entry and typed URL if the user requests | 222 // view to clear the pending entry and typed URL if the user requests |
223 // (e.g., hitting Escape with focus in the address bar). | 223 // (e.g., hitting Escape with focus in the address bar). |
224 // | 224 // |
225 // Note: don't touch the transient entry, since an interstitial may exist. | 225 // Note: don't touch the transient entry, since an interstitial may exist. |
226 bool should_preserve_entry = controller_->IsUnmodifiedBlankTab() || | 226 bool should_preserve_entry = controller_->IsUnmodifiedBlankTab() || |
227 delegate_->ShouldPreserveAbortedURLs(); | 227 delegate_->ShouldPreserveAbortedURLs(); |
228 if (controller_->GetPendingEntry() != controller_->GetVisibleEntry() || | 228 if (controller_->GetPendingEntry() != controller_->GetVisibleEntry() || |
229 !should_preserve_entry) { | 229 !should_preserve_entry) { |
230 controller_->DiscardPendingEntry(); | 230 controller_->DiscardPendingEntry(true); |
231 | 231 |
232 // Also force the UI to refresh. | 232 // Also force the UI to refresh. |
233 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 233 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
234 } | 234 } |
235 | 235 |
236 if (delegate_) | 236 if (delegate_) |
237 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); | 237 delegate_->DidFailProvisionalLoadWithError(render_frame_host, params); |
238 } | 238 } |
239 | 239 |
240 void NavigatorImpl::DidFailLoadWithError( | 240 void NavigatorImpl::DidFailLoadWithError( |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 891 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
892 time_to_commit); | 892 time_to_commit); |
893 UMA_HISTOGRAM_TIMES( | 893 UMA_HISTOGRAM_TIMES( |
894 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 894 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
895 time_to_network); | 895 time_to_network); |
896 } | 896 } |
897 navigation_data_.reset(); | 897 navigation_data_.reset(); |
898 } | 898 } |
899 | 899 |
900 } // namespace content | 900 } // namespace content |
OLD | NEW |