Offline page without native page content
This CL change the way offline pages are loaded in the
webState.
It uses the new WebState::LoadData to replace the current
DOM with an offline version of the page without triggering
a new navigation.
The URL of the navigation is the online version of the page.
This allow the online version to be loaded when reloading the
page.
Current known limitations:
chrome:// url is visible (shortly) when loading an offline
page (cl/1488924)
Restoring an offline page shows a white page. (crbug.com/937304)
Loading an offline page in place of a pending navigation is
not handled correctly (crbug.com/936773).
Bug: 929492
Change-Id: I6c9eb1513b6aa6b03a365e0d063af7e04ccaa15e
Reviewed-on: https://chromium-review.googlesource.com/c/1421103
Commit-Queue: Olivier Robin <[email protected]>
Reviewed-by: Eugene But <[email protected]>
Cr-Commit-Position: refs/heads/master@{#637248}
diff --git a/ios/chrome/browser/about_flags.mm b/ios/chrome/browser/about_flags.mm
index 73aeb19..62ae43f 100644
--- a/ios/chrome/browser/about_flags.mm
+++ b/ios/chrome/browser/about_flags.mm
@@ -52,6 +52,7 @@
#include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h"
#include "ios/chrome/browser/find_in_page/features.h"
#include "ios/chrome/browser/ios_chrome_flag_descriptions.h"
+#include "ios/chrome/browser/reading_list/features.h"
#include "ios/chrome/browser/search_engines/feature_flags.h"
#include "ios/chrome/browser/signin/feature_flags.h"
#include "ios/chrome/browser/system_flags.h"
@@ -567,6 +568,11 @@
flag_descriptions::kEnableSyncUSSPasswordsName,
flag_descriptions::kEnableSyncUSSPasswordsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(switches::kSyncUSSPasswords)},
+ {"offline-page-without-native-content",
+ flag_descriptions::kOfflineVersionWithoutNativeContentName,
+ flag_descriptions::kOfflineVersionWithoutNativeContentDescription,
+ flags_ui::kOsIos,
+ FEATURE_VALUE_TYPE(reading_list::kOfflineVersionWithoutNativeContent)},
};
// Add all switches from experimental flags to |command_line|.