Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: add back previews_unspecified Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 44873594afe061d98414abd3f993b87c5ff7d9de..c9ec788829f1f25e7503bdfe9500e92b10e1cdf4 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -44,6 +44,7 @@
#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_constants.h"
+#include "content/public/common/previews_state.h"
#include "content/public/common/resource_response.h"
#include "content/public/common/url_constants.h"
#include "net/base/net_errors.h"
@@ -338,17 +339,17 @@ bool NavigatorImpl::NavigateToEntry(
"navigation,rail", "NavigationTiming navigationStart",
TRACE_EVENT_SCOPE_GLOBAL, navigation_start);
- // Determine if LoFi should be used for the navigation.
- LoFiState lofi_state = LOFI_UNSPECIFIED;
+ // Determine if previews should be used for the navigation.
+ int previews_state = PREVIEWS_UNSPECIFIED;
nasko 2016/12/08 22:19:32 PreviewsState
megjablon 2016/12/09 20:35:53 Done.
if (!frame_tree_node->IsMainFrame()) {
// For subframes, use the state of the top-level frame.
- lofi_state = frame_tree_node->frame_tree()
+ previews_state = frame_tree_node->frame_tree()
->root()
->current_frame_host()
- ->last_navigation_lofi_state();
+ ->last_navigation_previews_state();
} else if (reload_type == ReloadType::DISABLE_LOFI_MODE) {
// Disable LoFi when asked for it explicitly.
- lofi_state = LOFI_OFF;
+ previews_state = PREVIEWS_OFF;
}
// PlzNavigate: the RenderFrameHosts are no longer asked to navigate.
@@ -356,7 +357,7 @@ bool NavigatorImpl::NavigateToEntry(
navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url,
entry.restore_type()));
RequestNavigation(frame_tree_node, dest_url, dest_referrer, frame_entry,
- entry, reload_type, lofi_state,
+ entry, reload_type, previews_state,
is_same_document_history_load,
is_history_navigation_in_new_child, navigation_start);
if (frame_tree_node->IsMainFrame() &&
@@ -426,7 +427,7 @@ bool NavigatorImpl::NavigateToEntry(
dest_render_frame_host->Navigate(
entry.ConstructCommonNavigationParams(
frame_entry, post_body, dest_url, dest_referrer, navigation_type,
- lofi_state, navigation_start),
+ previews_state, navigation_start),
entry.ConstructStartNavigationParams(),
entry.ConstructRequestNavigationParams(
frame_entry, is_same_document_history_load,
@@ -1126,7 +1127,7 @@ void NavigatorImpl::RequestNavigation(FrameTreeNode* frame_tree_node,
const FrameNavigationEntry& frame_entry,
const NavigationEntryImpl& entry,
ReloadType reload_type,
- LoFiState lofi_state,
+ int previews_state,
nasko 2016/12/08 22:19:32 PreviewsState
megjablon 2016/12/09 20:35:54 Done.
bool is_same_document_history_load,
bool is_history_navigation_in_new_child,
base::TimeTicks navigation_start) {
@@ -1143,7 +1144,7 @@ void NavigatorImpl::RequestNavigation(FrameTreeNode* frame_tree_node,
std::unique_ptr<NavigationRequest> scoped_request =
NavigationRequest::CreateBrowserInitiated(
frame_tree_node, dest_url, dest_referrer, frame_entry, entry,
- navigation_type, lofi_state, is_same_document_history_load,
+ navigation_type, previews_state, is_same_document_history_load,
is_history_navigation_in_new_child, navigation_start, controller_);
NavigationRequest* navigation_request = scoped_request.get();

Powered by Google App Engine
This is Rietveld 408576698