Append switches from experimental settings before chrome://flags.

As of now, if the enable-flags or disable-flags switch is used in
the experimental settings append flags section, it overrides the
features enabled/disabled from chrome://flags. With this change,
the switches from experimental settings are added first. Then,
when the chrome://flags are added, they will be merged into the
already existing switches from experimental settings.

Bug: 796279
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I523ad1188ae83438b1a995f08d88a9a296501f53
Reviewed-on: https://chromium-review.googlesource.com/837738
Reviewed-by: Justin Cohen <[email protected]>
Reviewed-by: Eric Noyau <[email protected]>
Commit-Queue: Eric Noyau <[email protected]>
Cr-Commit-Position: refs/heads/master@{#525665}
diff --git a/ios/chrome/browser/about_flags.mm b/ios/chrome/browser/about_flags.mm
index 6aa989c..f38d8d6 100644
--- a/ios/chrome/browser/about_flags.mm
+++ b/ios/chrome/browser/about_flags.mm
@@ -296,10 +296,10 @@
 
 void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage,
                             base::CommandLine* command_line) {
+  AppendSwitchesFromExperimentalSettings(command_line);
   FlagsStateSingleton::GetFlagsState()->ConvertFlagsToSwitches(
       flags_storage, command_line, flags_ui::kAddSentinels,
       switches::kEnableFeatures, switches::kDisableFeatures);
-  AppendSwitchesFromExperimentalSettings(command_line);
 }
 
 std::vector<std::string> RegisterAllFeatureVariationParameters(