This fixes several bugs introduced by #34913. Previously saved sessions with `brave://` virtual urls were not properly restored and brave:// urls were sometimes treated as searches on android
* Support contained tabs session restore and sync.
* Review fixes.
* Use struct as a return value instead of optional with out args.
* Add a unit test for view-source: scheme.
* Move TabRestore helper to components.
* Add containers-specific SerializedNavigationBuilder* tests.
* Guard PageState.top.url_string use.
* Add plaster files for few patches.
* Replace browser_tabrestore.cc #define patch with plaster rewrite.
* Replace content_serialized_navigation_builder.cc change with rewrite.
* Fix gn check.
* Add prefix_length check.
* Improve rewrite rules.
* Guard PageState changes with buildflag.
* Rename StoragePartitionKeyToUrlPrefix.
* Add buildflag check into SerializedNavigationEntry.
* Fix build issues with containers buildflag disabled.
* Fix iOS build.
fix https://github.com/brave/brave-browser/issues/30890
As we sanitize serialzed navigation(https://github.com/brave/brave-browser/issues/30890),
encoded page state is empty for all chrome url.
So, new page state is created with virtual url when it's restored during the startup.
ContentSerializedNavigationBuilder::ToNavigationEntry() set new page state if it's empty.
When new page state is created, navigation's virtual url is created.
If url is re-written when NavigationEntryImpl is created, that re-written url is ignored.
To fix this, including url info only for chrome url's encoded page state.