Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 416 controller_->GetLastCommittedEntryIndex(), | 416 controller_->GetLastCommittedEntryIndex(), |
| 417 controller_->GetEntryCount())); | 417 controller_->GetEntryCount())); |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 | 420 |
| 421 // Make sure no code called via RFH::Navigate clears the pending entry. | 421 // Make sure no code called via RFH::Navigate clears the pending entry. |
| 422 if (is_pending_entry) | 422 if (is_pending_entry) |
| 423 CHECK_EQ(controller_->GetPendingEntry(), &entry); | 423 CHECK_EQ(controller_->GetPendingEntry(), &entry); |
| 424 | 424 |
| 425 if (controller_->GetPendingEntryIndex() == -1 && | 425 if (controller_->GetPendingEntryIndex() == -1 && |
| 426 IsRendererDebugURL(dest_url)) { | 426 dest_url.SchemeIs(url::kJavaScriptScheme)) { |
|
jam
2016/10/13 20:27:52
I made this change while changing another line bel
| |
| 427 // If the pending entry index is -1 (which means a new navigation rather | 427 // If the pending entry index is -1 (which means a new navigation rather |
| 428 // than a history one), and the user typed in a debug URL, don't add it to | 428 // than a history one), and the user typed in a javascript: URL, don't add |
| 429 // the session history. | 429 // it to the session history. |
| 430 // | 430 // |
| 431 // This is a hack. What we really want is to avoid adding to the history any | 431 // This is a hack. What we really want is to avoid adding to the history any |
| 432 // URL that doesn't generate content, and what would be great would be if we | 432 // URL that doesn't generate content, and what would be great would be if we |
| 433 // had a message from the renderer telling us that a new page was not | 433 // had a message from the renderer telling us that a new page was not |
| 434 // created. The same message could be used for mailto: URLs and the like. | 434 // created. The same message could be used for mailto: URLs and the like. |
| 435 return false; | 435 return false; |
| 436 } | 436 } |
| 437 | 437 |
| 438 // Notify observers about navigation. | 438 // Notify observers about navigation. |
| 439 if (delegate_ && is_pending_entry) | 439 if (delegate_ && is_pending_entry) |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1237 if (navigation_handle) | 1237 if (navigation_handle) |
| 1238 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); | 1238 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); |
| 1239 | 1239 |
| 1240 controller_->SetPendingEntry(std::move(entry)); | 1240 controller_->SetPendingEntry(std::move(entry)); |
| 1241 if (delegate_) | 1241 if (delegate_) |
| 1242 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 1242 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 1243 } | 1243 } |
| 1244 } | 1244 } |
| 1245 | 1245 |
| 1246 } // namespace content | 1246 } // namespace content |
| OLD | NEW |