| 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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "url/url_constants.h" | 45 #include "url/url_constants.h" |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| 51 FrameMsg_Navigate_Type::Value GetNavigationType( | 51 FrameMsg_Navigate_Type::Value GetNavigationType( |
| 52 BrowserContext* browser_context, const NavigationEntryImpl& entry, | 52 BrowserContext* browser_context, const NavigationEntryImpl& entry, |
| 53 NavigationController::ReloadType reload_type) { | 53 NavigationController::ReloadType reload_type) { |
| 54 switch (reload_type) { | 54 switch (reload_type) { |
| 55 case NavigationControllerImpl::RELOAD: | 55 case NavigationController::RELOAD: |
| 56 return FrameMsg_Navigate_Type::RELOAD; | 56 return FrameMsg_Navigate_Type::RELOAD; |
| 57 case NavigationControllerImpl::RELOAD_BYPASSING_CACHE: | 57 case NavigationController::RELOAD_MAIN_RESOURCE: |
| 58 case NavigationControllerImpl::RELOAD_DISABLE_LOFI_MODE: | 58 return FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE; |
| 59 case NavigationController::RELOAD_BYPASSING_CACHE: |
| 60 case NavigationController::RELOAD_DISABLE_LOFI_MODE: |
| 59 return FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE; | 61 return FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE; |
| 60 case NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL: | 62 case NavigationController::RELOAD_ORIGINAL_REQUEST_URL: |
| 61 return FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; | 63 return FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; |
| 62 case NavigationControllerImpl::NO_RELOAD: | 64 case NavigationController::NO_RELOAD: |
| 63 break; // Fall through to rest of function. | 65 break; // Fall through to rest of function. |
| 64 } | 66 } |
| 65 | 67 |
| 66 // |RenderViewImpl::PopulateStateFromPendingNavigationParams| differentiates | 68 // |RenderViewImpl::PopulateStateFromPendingNavigationParams| differentiates |
| 67 // between |RESTORE_WITH_POST| and |RESTORE|. | 69 // between |RESTORE_WITH_POST| and |RESTORE|. |
| 68 if (entry.restore_type() == | 70 if (entry.restore_type() == |
| 69 NavigationEntryImpl::RESTORE_LAST_SESSION_EXITED_CLEANLY) { | 71 NavigationEntryImpl::RESTORE_LAST_SESSION_EXITED_CLEANLY) { |
| 70 if (entry.GetHasPostData()) | 72 if (entry.GetHasPostData()) |
| 71 return FrameMsg_Navigate_Type::RESTORE_WITH_POST; | 73 return FrameMsg_Navigate_Type::RESTORE_WITH_POST; |
| 72 return FrameMsg_Navigate_Type::RESTORE; | 74 return FrameMsg_Navigate_Type::RESTORE; |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 if (pending_entry != controller_->GetVisibleEntry() || | 1149 if (pending_entry != controller_->GetVisibleEntry() || |
| 1148 !should_preserve_entry) { | 1150 !should_preserve_entry) { |
| 1149 controller_->DiscardPendingEntry(true); | 1151 controller_->DiscardPendingEntry(true); |
| 1150 | 1152 |
| 1151 // Also force the UI to refresh. | 1153 // Also force the UI to refresh. |
| 1152 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1154 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1153 } | 1155 } |
| 1154 } | 1156 } |
| 1155 | 1157 |
| 1156 } // namespace content | 1158 } // namespace content |
| OLD | NEW |