diff --git a/BUILD.gn b/BUILD.gn
index 8c08120..f39930e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -931,6 +931,7 @@
     testonly = true
     data_deps = [
       "//content/shell:content_shell",
+      "//third_party/WebKit/public:blink_devtools_frontend_resources_files",
       "//third_party/mesa:osmesa",
       "//tools/imagediff",
     ]
@@ -968,6 +969,7 @@
       "//testing/xvfb.py",
       "//testing/scripts/run_isolated_script_test.py",
       "//third_party/WebKit/LayoutTests/",
+      "//third_party/WebKit/PerformanceTests/",
       "//third_party/WebKit/Tools/Scripts/",
       "$root_build_dir/resources/inspector/",
     ]
diff --git a/DEPS b/DEPS
index 6f2df05..9964530 100644
--- a/DEPS
+++ b/DEPS
@@ -196,7 +196,7 @@
     Var('chromium_git') + '/external/bidichecker/lib.git' + '@' + '97f2aa645b74c28c57eca56992235c79850fa9e0',
 
   'src/third_party/webgl/src':
-    Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'c02db7653f0a0af14fd3303044279b8e4234d80b',
+    Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd0783b85bd445f700576dba25bf452d58c112d33',
 
   'src/third_party/webdriver/pylib':
     Var('chromium_git') + '/external/selenium/py.git' + '@' + '5fd78261a75fe08d27ca4835fb6c5ce4b42275bd',
diff --git a/chrome/VERSION b/chrome/VERSION
index 8eecc75b..4d5b2fc 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=58
 MINOR=0
-BUILD=3016
+BUILD=3017
 PATCH=0
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index b5b9a97..a45f50c 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -631,6 +631,23 @@
         <service android:name="org.chromium.chrome.browser.physicalweb.NearbyMessageIntentService"
             android:exported="false" />
 
+        <!-- This activity is to expose the PhysicalWeb Share option via the generic Android share action. -->
+        <activity
+            android:name="org.chromium.chrome.browser.physicalweb.PhysicalWebShareActivity"
+            android:icon="@drawable/physical_web_notification_large"
+            android:label="@string/physical_web_share_activity_title"
+            android:enabled="false"
+            android:excludeFromRecents="true"
+            android:noHistory="true"
+            android:theme="@android:style/Theme.NoDisplay"
+            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" >
+            <intent-filter>
+                <action android:name="android.intent.action.SEND" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <data android:mimeType="text/plain" />
+            </intent-filter>
+        </activity>
+
         <!-- Providers for chrome data. -->
         <provider android:name="org.chromium.chrome.browser.provider.ChromeBrowserProvider"
             android:authorities="{{ manifest_package }}.ChromeBrowserProvider;{{ manifest_package }}.browser;{{ manifest_package }}"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index d0bca3b4..ada13e5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -98,6 +98,7 @@
 import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
 import org.chromium.chrome.browser.pageinfo.WebsiteSettingsPopup;
 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
+import org.chromium.chrome.browser.physicalweb.PhysicalWebShareActivity;
 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
 import org.chromium.chrome.browser.preferences.PrefServiceBridge;
 import org.chromium.chrome.browser.preferences.PreferencesLauncher;
@@ -1157,9 +1158,16 @@
         final Tab currentTab = getActivityTab();
         if (currentTab == null) return;
 
+        List<Class<? extends Activity>> classesToEnable = new ArrayList<>(2);
+
         if (PrintShareActivity.printingIsEnabled(currentTab)) {
-            List<Class<? extends Activity>> classesToEnable = new ArrayList<>(1);
             classesToEnable.add(PrintShareActivity.class);
+        }
+        if (PhysicalWebShareActivity.sharingIsEnabled(currentTab)) {
+            classesToEnable.add(PhysicalWebShareActivity.class);
+        }
+
+        if (!classesToEnable.isEmpty()) {
             OptionalShareTargetsManager.enableOptionalShareActivities(
                     this, classesToEnable, new Runnable() {
                         @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
index d19dca7..20e2d429 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
@@ -25,6 +25,7 @@
     public static final int OPTIN_NOTIFY_MAX_TRIES = 1;
     private static final String PREF_PHYSICAL_WEB_NOTIFY_COUNT = "physical_web_notify_count";
     private static final String FEATURE_NAME = "PhysicalWeb";
+    private static final String PHYSICAL_WEB_SHARING_FEATURE_NAME = "PhysicalWebSharing";
     private static final int MIN_ANDROID_VERSION = 18;
 
     /**
@@ -47,6 +48,15 @@
     }
 
     /**
+     * Checks whether the Physical Web Sharing feature is enabled.
+     *
+     * @return boolean {@code true} if the feature is enabled
+     */
+    public static boolean sharingIsEnabled() {
+        return ChromeFeatureList.isEnabled(PHYSICAL_WEB_SHARING_FEATURE_NAME);
+    }
+
+    /**
      * Checks whether the Physical Web onboard flow is active and the user has
      * not yet elected to either enable or decline the feature.
      *
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
new file mode 100644
index 0000000..5fe13a3
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.physicalweb;
+
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+
+import org.chromium.chrome.browser.share.ShareHelper;
+import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.util.IntentUtils;
+
+/**
+ * A simple activity that allows Chrome to start the physical web sharing service.
+ */
+public class PhysicalWebShareActivity extends AppCompatActivity {
+    private static final String TAG = "PhysicalWebShareActivity";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        try {
+            Intent intent = getIntent();
+            if (intent == null) return;
+            if (!Intent.ACTION_SEND.equals(intent.getAction())) return;
+            if (!IntentUtils.safeHasExtra(getIntent(), ShareHelper.EXTRA_TASK_ID)) return;
+            handleShareAction();
+        } finally {
+            finish();
+        }
+    }
+
+    private void handleShareAction() {
+        // TODO(iankc): implement sharing
+    }
+
+    public static boolean sharingIsEnabled(Tab currentTab) {
+        return PhysicalWeb.sharingIsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
+    }
+}
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
index 1f475d8..cd1dbd04 100644
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -2615,6 +2615,9 @@
       <message name="IDS_PHYSICAL_WEB_LAUNCH_BUTTON" desc="The label for a button that opens a list of nearby URLs">
         See what's nearby
       </message>
+      <message name="IDS_PHYSICAL_WEB_SHARE_ACTIVITY_TITLE" desc="Title of the Physical Web Share activity that will appear in the Android share dialog.">
+        Physical Web
+      </message>
 
       <!-- WebUsb Picker UI strings -->
       <message name="IDS_USB_CHOOSER_DIALOG_PROMPT" desc="The text that is used to introduce the USB chooser dialog to the user.">
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index 87fb0bc..97f9a63c 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -738,6 +738,7 @@
   "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java",
   "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java",
   "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java",
+  "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java",
   "java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java",
   "java/src/org/chromium/chrome/browser/physicalweb/PwCollection.java",
   "java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java",
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 84c4713..e89f3dfb 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -769,6 +769,24 @@
             Chromium has detected unusual behavior
         </message>
       </if>
+
+      <!-- Settings reset prompt dialog messages -->
+      <message name="IDS_SETTINGS_RESET_PROMPT_TITLE" desc="The title for the settings reset dialog. The dialog alerts users that some of their settings may be unwanted and asks if they want to restore some of their settings to their original default values.">
+        Chromium has detected potentially unwanted settings
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_EXPLANATION_FOR_MULTIPLE_SETTINGS" desc="Text shown in the settings reset dialog explaining that some of the user's settings may have been modified by unwanted software or extensions.">
+        The following Chromium settings may have been modified by unwanted software or extensions:
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_SEARCH_ENGINE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their search engine.">
+        Do you want to restore Chromium's default search engine?
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_STARTUP_PAGE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their startup page.">
+        Do you want to restore Chromium's default startup page?
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_HOMEPAGE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their homepage.">
+        Do you want to restore Chromium's default homepage?
+      </message>
+
       <!-- Sync/sign-in error messages -->
       <if expr="not chromeos">
         <message name="IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE" desc="Message in the sync error bubble view when the user needs to update their sync passphrase.">
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 70d6e18..850b9ede 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -8005,6 +8005,59 @@
         </message>
       </if>
 
+      <!-- Settings reset prompt dialog messages -->
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACCEPT_BUTTON_LABEL" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is displayed on the accept button that, when clicked, will perform the reset operation.">
+        Restore default settings
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_SHOW_DETAILS_BUTTON_LABEL" desc="The text on the button in the settings reset dialog that will expand the dialog to show more details.">
+        Show details
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_HIDE_DETAILS_BUTTON_LABEL" desc="The text on the button in the settings reset dialog that will hide the details section.">
+        Hide details
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_EXPLANATION_FOR_SEARCH_ENGINE" desc="Text shown in the settings reset dialog explaining that the user's search engine may have been modified by unwanted software or extensions.">
+        Your search engine may have been modified by unwanted software or extensions.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_EXPLANATION_FOR_STARTUP_PAGE" desc="Text shown in the settings reset dialog explaining that the user's startup page may have been modified by unwanted software or extensions.">
+        Your startup page may have been modified by unwanted software or extensions.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_EXPLANATION_FOR_HOMEPAGE" desc="Text shown in the settings reset dialog explaining that the user's homepage may have been modified by unwanted software or extensions.">
+        Your homepage may have been modified by unwanted software or extensions.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_SEARCH_ENGINE_SETTING_NAME" desc="The text referring to Chrome's search engine setting. This will be displayed in a bulleted list of settings when informing the user that some of their settings may have been modified by unwanted software or extensions.">
+        Search engine
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_STARTUP_PAGE_SETTING_NAME" desc="The text referring to Chrome's startup page setting. This will be displayed in a bulleted list of settings when informing the user that some of their settings may have been modified by unwanted software or extensions.">
+        Startup page
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_HOMEPAGE_SETTING_NAME" desc="The text referring to Chrome's homepage setting. This will be displayed in a bulleted list of settings when informing the user that some of their settings may have been modified by unwanted software or extensions.">
+        Homepage
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_MULTIPLE_SETTINGS" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset the settings that were shown in a list and that may have been modified by unwanted software or extensions.">
+        Do you want to restore these settings to their original defaults?
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_SINGLE_EXTENSION" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown to inform the user about the number of extensions that will be disabled as part of the reset operation.">
+        This will also disable one extension.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_MULTIPLE_EXTENSIONS" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown to inform the user about the number of extensions that will be disabled as part of the reset operation.">
+        This will also disable <ph name="NUM_EXTENSIONS">$1<ex>3</ex></ph> extensions.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_DETAILS_SECTION_SETTINGS_EXPLANATION" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is displayed in the details section of the dialog before listing the current values of the settings that will be reset if the user clicks the accept button.">
+        The following settings will be restored to their default values.
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_DETAILS_SECTION_EXTENSION_EXPLANATION" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is displayed in the details section of the dialog before listing all the Chrome extensions that will be disabled if the user clicks the accept button.">
+        The following extensions will be disabled (you can enable them again later):
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_DETAILED_SEARCH_ENGINE_SETTING" desc="The text to be shown in the settings reset dialog when referring to Chrome's current search engine setting. The current value of the setting, which will be changed if the user clicks the accept button in the dialog, will be displayed on the next line.">
+        Search engine, which is currently set to:
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_DETAILED_STARTUP_SETTINGS" desc="The text to be shown in the settings reset dialog when referring to Chrome's current startup page setting. The current set of startup pages, which will be changed if the user clicks the accept button in the dialog, will be displayed after this text.">
+        Startup pages, which are currently set to:
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_DETAILED_HOMEPAGE_SETTING" desc="The text to be shown in the settings reset dialog when referring to Chrome's current homepage setting. The current value of the setting, which will be changed if the user clicks the accept button in the dialog, will be displayed on the next line.">
+        Homepage, which is currently set to:
+      </message>
+
       <!-- Upgrade bubble messages -->
       <message name="IDS_REENABLE_UPDATES" desc="Text for the button the user clicks to re-enable automatic updates.">
         Enable autoupdate
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index 4e570aa..1f01702 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -770,6 +770,24 @@
             Chrome has detected unusual behavior
         </message>
       </if>
+
+      <!-- Settings reset prompt dialog messages -->
+      <message name="IDS_SETTINGS_RESET_PROMPT_TITLE" desc="The title for the settings reset dialog. The dialog alerts users that some of their settings may be unwanted and asks if they want to restore some of their settings to their original default values.">
+        Chrome has detected potentially unwanted settings
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_EXPLANATION_FOR_MULTIPLE_SETTINGS" desc="Text shown in the settings reset dialog explaining that some of the user's settings may have been modified by unwanted software or extensions.">
+        The following Chrome settings may have been modified by unwanted software or extensions:
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_SEARCH_ENGINE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their search engine.">
+        Do you want to restore Chrome's default search engine?
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_STARTUP_PAGE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their startup page.">
+        Do you want to restore Chrome's default startup page?
+      </message>
+      <message name="IDS_SETTINGS_RESET_PROMPT_ACTION_EXPLANATION_FOR_HOMEPAGE" desc="The settings reset dialog asks users if they want to restore some of their settings to their original default values. This text is shown at the bottom of the dialog when asking if the user wants to reset their homepage.">
+        Do you want to restore Chrome's default homepage?
+      </message>
+
       <!-- Sync/sign-in error messages -->
       <if expr="not chromeos">
         <message name="IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE" desc="Message in the sync error bubble view when the user needs to update their sync passphrase.">
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
index 1fb36b28..14765cff 100644
--- a/chrome/browser/android/chrome_feature_list.cc
+++ b/chrome/browser/android/chrome_feature_list.cc
@@ -60,6 +60,7 @@
     &NTPShowGoogleGInOmniboxFeature,
     &kNTPSuggestionsStandaloneUIFeature,
     &kPhysicalWebFeature,
+    &kPhysicalWebSharing,
     &kSpecialLocaleFeature,
     &kSpecialLocaleWrapper,
     &kTabsInCBD,
@@ -149,6 +150,9 @@
 const base::Feature kPhysicalWebFeature{"PhysicalWeb",
                                         base::FEATURE_ENABLED_BY_DEFAULT};
 
+const base::Feature kPhysicalWebSharing{"PhysicalWebSharing",
+                                        base::FEATURE_DISABLED_BY_DEFAULT};
+
 const base::Feature kSpecialLocaleFeature{"SpecialLocale",
                                           base::FEATURE_DISABLED_BY_DEFAULT};
 
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h
index 9e7ec98b..31f422f 100644
--- a/chrome/browser/android/chrome_feature_list.h
+++ b/chrome/browser/android/chrome_feature_list.h
@@ -32,6 +32,7 @@
 extern const base::Feature NTPShowGoogleGInOmniboxFeature;
 extern const base::Feature kNTPSuggestionsStandaloneUIFeature;
 extern const base::Feature kPhysicalWebFeature;
+extern const base::Feature kPhysicalWebSharing;
 extern const base::Feature kSpecialLocaleFeature;
 extern const base::Feature kSpecialLocaleWrapper;
 extern const base::Feature kTabsInCBD;
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 7eab36a..6ae5cb9 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -118,12 +118,8 @@
   registry->RegisterBooleanPref(prefs::kArcEnabled, false);
   registry->RegisterBooleanPref(prefs::kArcSignedIn, false);
   registry->RegisterBooleanPref(prefs::kArcTermsAccepted, false);
-  // Note that ArcBackupRestoreEnabled and ArcLocationServiceEnabled prefs have
-  // to be off by default, until an explicit gesture from the user to enable
-  // them is received. This is crucial in the cases when these prefs transition
-  // from a previous managed state to the unmanaged.
-  registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, false);
-  registry->RegisterBooleanPref(prefs::kArcLocationServiceEnabled, false);
+  registry->RegisterBooleanPref(prefs::kArcBackupRestoreEnabled, true);
+  registry->RegisterBooleanPref(prefs::kArcLocationServiceEnabled, true);
 }
 
 // static
@@ -710,30 +706,18 @@
     return;
   }
 
-  PrefService* const prefs = profile_->GetPrefs();
-
   // For ARC Kiosk we skip ToS because it is very likely that near the device
   // there will be no one who is eligible to accept them.
   // TODO(poromov): Move to more Kiosk dedicated set-up phase.
   if (IsArcKioskMode())
-    prefs->SetBoolean(prefs::kArcTermsAccepted, true);
-
-  // Skip to show UI asking users to enable/disable their preference for
-  // backup-restore and location-service, if both are managed by the admin
-  // policy. Note that the ToS agreement is anyway not shown in the case of the
-  // managed ARC.
-  if (IsArcManaged() &&
-      prefs->IsManagedPreference(prefs::kArcBackupRestoreEnabled) &&
-      prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled)) {
-    prefs->SetBoolean(prefs::kArcTermsAccepted, true);
-  }
+    profile_->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, true);
 
   // If it is marked that sign in has been successfully done, then directly
   // start ARC.
-  // For testing, and for Kiosk mode, we also skip ToS negotiation procedure.
+  // For testing, and for Kisok mode, we also skip ToS negotiation procedure.
   // For backward compatibility, this check needs to be prior to the
   // kArcTermsAccepted check below.
-  if (prefs->GetBoolean(prefs::kArcSignedIn) ||
+  if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn) ||
       IsArcOptInVerificationDisabled() || IsArcKioskMode()) {
     StartArc();
 
@@ -767,12 +751,10 @@
   // 1) User accepted the Terms of service on OOBE flow.
   // 2) User accepted the Terms of service on Opt-in flow, but logged out
   //   before ARC sign in procedure was done. Then, logs in again.
-  if (prefs->GetBoolean(prefs::kArcTermsAccepted)) {
+  if (profile_->GetPrefs()->GetBoolean(prefs::kArcTermsAccepted)) {
     // Don't show UI for this progress if it was not shown.
-    if (support_host_ &&
-        support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE) {
+    if (support_host_->ui_page() != ArcSupportHost::UIPage::NO_PAGE)
       support_host_->ShowArcLoading();
-    }
     StartArcAndroidManagementCheck();
     return;
   }
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
index 98d8e147..a2ae503 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -4,7 +4,6 @@
 
 #include <memory>
 #include <string>
-#include <tuple>
 #include <vector>
 
 #include "base/bind.h"
@@ -12,12 +11,10 @@
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/logging.h"
 #include "base/macros.h"
 #include "base/memory/ptr_util.h"
 #include "base/observer_list.h"
 #include "base/run_loop.h"
-#include "base/values.h"
 #include "chrome/browser/chromeos/arc/arc_optin_uma.h"
 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_oobe_negotiator.h"
@@ -45,7 +42,6 @@
 #include "components/arc/arc_util.h"
 #include "components/arc/test/fake_arc_session.h"
 #include "components/prefs/pref_service.h"
-#include "components/prefs/testing_pref_service.h"
 #include "components/signin/core/account_id/account_id.h"
 #include "components/sync/model/fake_sync_change_processor.h"
 #include "components/sync/model/sync_error_factory_mock.h"
@@ -571,75 +567,6 @@
   arc_session_manager()->Shutdown();
 }
 
-class ArcSessionManagerPolicyTest
-    : public ArcSessionManagerTest,
-      public testing::WithParamInterface<std::tuple<base::Value, base::Value>> {
- public:
-  const base::Value& backup_restore_pref_value() const {
-    return std::get<0>(GetParam());
-  }
-
-  const base::Value& location_service_pref_value() const {
-    return std::get<1>(GetParam());
-  }
-};
-
-TEST_P(ArcSessionManagerPolicyTest, SkippingTerms) {
-  sync_preferences::TestingPrefServiceSyncable* const prefs =
-      profile()->GetTestingPrefService();
-
-  // Backup-restore and location-service prefs are off by default.
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn));
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcTermsAccepted));
-
-  // Set ARC to be managed.
-  prefs->SetManagedPref(prefs::kArcEnabled, new base::Value(true));
-
-  // Assign test values to the prefs.
-  if (backup_restore_pref_value().is_bool()) {
-    prefs->SetManagedPref(prefs::kArcBackupRestoreEnabled,
-                          backup_restore_pref_value().DeepCopy());
-  }
-  if (location_service_pref_value().is_bool()) {
-    prefs->SetManagedPref(prefs::kArcLocationServiceEnabled,
-                          location_service_pref_value().DeepCopy());
-  }
-
-  arc_session_manager()->OnPrimaryUserProfilePrepared(profile());
-  EXPECT_TRUE(arc_session_manager()->IsArcPlayStoreEnabled());
-  EXPECT_TRUE(arc_session_manager()->IsArcManaged());
-
-  // Terms of Service should be skipped if both ArcBackupRestoreEnabled and
-  // ArcLocationServiceEnabled are managed.
-  const ArcSessionManager::State expected_state =
-      backup_restore_pref_value().is_bool() &&
-              location_service_pref_value().is_bool()
-          ? ArcSessionManager::State::ACTIVE
-          : ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE;
-  EXPECT_EQ(expected_state, arc_session_manager()->state());
-
-  // Managed values for the prefs are unset.
-  prefs->RemoveManagedPref(prefs::kArcBackupRestoreEnabled);
-  prefs->RemoveManagedPref(prefs::kArcLocationServiceEnabled);
-
-  // The ARC state is preserved. The prefs return to the default false values.
-  EXPECT_EQ(expected_state, arc_session_manager()->state());
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
-
-  // Stop ARC and shutdown the service.
-  prefs->RemoveManagedPref(prefs::kArcEnabled);
-  WaitForDataRemoved(ArcSessionManager::State::STOPPED);
-  arc_session_manager()->Shutdown();
-}
-
-INSTANTIATE_TEST_CASE_P(
-    ArcSessionManagerPolicyTest,
-    ArcSessionManagerPolicyTest,
-    testing::Combine(
-        testing::Values(base::Value(), base::Value(false), base::Value(true)),
-        testing::Values(base::Value(), base::Value(false), base::Value(true))));
-
 class ArcSessionManagerKioskTest : public ArcSessionManagerTestBase {
  public:
   ArcSessionManagerKioskTest() = default;
diff --git a/chrome/browser/chromeos/arc/extensions/fake_arc_support.h b/chrome/browser/chromeos/arc/extensions/fake_arc_support.h
index f34b0ee0..a0af1b5 100644
--- a/chrome/browser/chromeos/arc/extensions/fake_arc_support.h
+++ b/chrome/browser/chromeos/arc/extensions/fake_arc_support.h
@@ -32,10 +32,6 @@
   // Emulates clicking Agree button.
   void ClickAgreeButton();
 
-  bool metrics_mode() const { return metrics_mode_; }
-  bool backup_and_restore_mode() const { return backup_and_restore_mode_; }
-  bool location_service_mode() const { return location_service_mode_; }
-
   // Emulates checking preference box.
   void set_metrics_mode(bool mode) { metrics_mode_ = mode; }
   void set_backup_and_restore_mode(bool mode) {
diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc b/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc
index 008a1c4..b52c9ca 100644
--- a/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc
+++ b/chrome/browser/chromeos/arc/intent_helper/arc_settings_service.cc
@@ -65,15 +65,12 @@
   return !host->empty() && *port;
 }
 
-PrefService* GetPrefs() {
-  return ProfileManager::GetActiveUserProfile()->GetPrefs();
-}
-
 // Returns whether kProxy pref proxy config is applied.
 bool IsPrefProxyConfigApplied() {
   net::ProxyConfig config;
+  Profile* profile = ProfileManager::GetActiveUserProfile();
   return PrefProxyConfigTrackerImpl::PrefPrecedes(
-      PrefProxyConfigTrackerImpl::ReadPrefConfig(GetPrefs(), &config));
+      PrefProxyConfigTrackerImpl::ReadPrefConfig(profile->GetPrefs(), &config));
 }
 
 }  // namespace
@@ -115,23 +112,18 @@
   // Stops listening for Chrome settings changes.
   void StopObservingSettingsChanges();
 
-  // Retrieves Chrome's state for the settings that need to be synced on the
-  // initial Android boot and send it to Android.
-  void SyncInitialSettings() const;
   // Retrieves Chrome's state for the settings that need to be synced on each
   // Android boot and send it to Android.
   void SyncRuntimeSettings() const;
-  // Determine whether a particular setting needs to be synced to Android.
-  // Keep these lines ordered lexicographically.
-  bool ShouldSyncBackupEnabled() const;
-  bool ShouldSyncLocationServiceEnabled() const;
-  // Send particular settings to Android.
+  // Send settings that need to be synced only on Android first start to
+  // Android.
   // Keep these lines ordered lexicographically.
   void SyncAccessibilityLargeMouseCursorEnabled() const;
   void SyncAccessibilityVirtualKeyboardEnabled() const;
   void SyncBackupEnabled() const;
   void SyncFocusHighlightEnabled() const;
   void SyncFontSize() const;
+  void SyncInitialSettings() const;
   void SyncLocale() const;
   void SyncLocationServiceEnabled() const;
   void SyncProxySettings() const;
@@ -212,11 +204,10 @@
     SyncSpokenFeedbackEnabled();
   } else if (pref_name == prefs::kAccessibilityVirtualKeyboardEnabled) {
     SyncAccessibilityVirtualKeyboardEnabled();
-  } else if (pref_name == prefs::kArcBackupRestoreEnabled) {
-    if (ShouldSyncBackupEnabled())
-      SyncBackupEnabled();
   } else if (pref_name == prefs::kArcLocationServiceEnabled) {
-    if (ShouldSyncLocationServiceEnabled())
+    const PrefService* const prefs =
+        ProfileManager::GetActiveUserProfile()->GetPrefs();
+    if (prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled))
       SyncLocationServiceEnabled();
   } else if (pref_name == prefs::kUse24HourClock) {
     SyncUse24HourClock();
@@ -258,7 +249,8 @@
 }
 
 void ArcSettingsServiceImpl::StartObservingSettingsChanges() {
-  registrar_.Init(GetPrefs());
+  Profile* profile = ProfileManager::GetActiveUserProfile();
+  registrar_.Init(profile->GetPrefs());
 
   // Keep these lines ordered lexicographically.
   AddPrefToObserve(prefs::kAccessibilityFocusHighlightEnabled);
@@ -301,12 +293,6 @@
       this, FROM_HERE);
 }
 
-void ArcSettingsServiceImpl::SyncInitialSettings() const {
-  // Keep these lines ordered lexicographically.
-  SyncBackupEnabled();
-  SyncLocationServiceEnabled();
-}
-
 void ArcSettingsServiceImpl::SyncRuntimeSettings() const {
   // Keep these lines ordered lexicographically.
   SyncAccessibilityLargeMouseCursorEnabled();
@@ -320,28 +306,14 @@
   SyncTimeZone();
   SyncUse24HourClock();
 
-  if (ShouldSyncBackupEnabled())
+  const PrefService* const prefs =
+      ProfileManager::GetActiveUserProfile()->GetPrefs();
+  if (prefs->IsManagedPreference(prefs::kArcBackupRestoreEnabled))
     SyncBackupEnabled();
-  if (ShouldSyncLocationServiceEnabled())
+  if (prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled))
     SyncLocationServiceEnabled();
 }
 
-bool ArcSettingsServiceImpl::ShouldSyncBackupEnabled() const {
-  // Always sync the managed setting. Also sync when the pref is unset, which
-  // normally happens once after the pref changes from the managed state to
-  // unmanaged.
-  return GetPrefs()->IsManagedPreference(prefs::kArcBackupRestoreEnabled) ||
-         !GetPrefs()->HasPrefPath(prefs::kArcBackupRestoreEnabled);
-}
-
-bool ArcSettingsServiceImpl::ShouldSyncLocationServiceEnabled() const {
-  // Always sync the managed setting. Also sync when the pref is unset, which
-  // normally happens once after the pref changes from the managed state to
-  // unmanaged.
-  return GetPrefs()->IsManagedPreference(prefs::kArcLocationServiceEnabled) ||
-         !GetPrefs()->HasPrefPath(prefs::kArcLocationServiceEnabled);
-}
-
 void ArcSettingsServiceImpl::SyncAccessibilityLargeMouseCursorEnabled() const {
   SendBoolPrefSettingsBroadcast(
       prefs::kAccessibilityLargeCursorEnabled,
@@ -358,15 +330,6 @@
   SendBoolPrefSettingsBroadcast(
       prefs::kArcBackupRestoreEnabled,
       "org.chromium.arc.intent_helper.SET_BACKUP_ENABLED");
-  if (GetPrefs()->IsManagedPreference(prefs::kArcBackupRestoreEnabled)) {
-    // Unset the user pref so that if the pref becomes unmanaged at some point,
-    // this change will be synced.
-    GetPrefs()->ClearPref(prefs::kArcBackupRestoreEnabled);
-  } else if (!GetPrefs()->HasPrefPath(prefs::kArcBackupRestoreEnabled)) {
-    // Set the pref value in order to prevent the subsequent syncing. The
-    // "false" value is a safe default from the legal/privacy perspective.
-    GetPrefs()->SetBoolean(prefs::kArcBackupRestoreEnabled, false);
-  }
 }
 
 void ArcSettingsServiceImpl::SyncFocusHighlightEnabled() const {
@@ -389,6 +352,11 @@
                         extras);
 }
 
+void ArcSettingsServiceImpl::SyncInitialSettings() const {
+  SyncBackupEnabled();
+  SyncLocationServiceEnabled();
+}
+
 void ArcSettingsServiceImpl::SyncLocale() const {
   const PrefService::Preference* pref =
       registrar_.prefs()->FindPreference(prefs::kApplicationLocale);
@@ -405,21 +373,13 @@
   SendBoolPrefSettingsBroadcast(
       prefs::kArcLocationServiceEnabled,
       "org.chromium.arc.intent_helper.SET_LOCATION_SERVICE_ENABLED");
-  if (GetPrefs()->IsManagedPreference(prefs::kArcLocationServiceEnabled)) {
-    // Unset the user pref so that if the pref becomes unmanaged at some point,
-    // this change will be synced.
-    GetPrefs()->ClearPref(prefs::kArcLocationServiceEnabled);
-  } else if (!GetPrefs()->HasPrefPath(prefs::kArcLocationServiceEnabled)) {
-    // Set the pref value in order to prevent the subsequent syncing. The
-    // "false" value is a safe default from the legal/privacy perspective.
-    GetPrefs()->SetBoolean(prefs::kArcLocationServiceEnabled, false);
-  }
 }
 
 void ArcSettingsServiceImpl::SyncProxySettings() const {
   std::unique_ptr<ProxyConfigDictionary> proxy_config_dict =
       chromeos::ProxyConfigServiceImpl::GetActiveProxyConfigDictionary(
-          GetPrefs(), g_browser_process->local_state());
+          ProfileManager::GetActiveUserProfile()->GetPrefs(),
+          g_browser_process->local_state());
   if (!proxy_config_dict)
     return;
 
diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc b/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
index b6af8900..bdc2589 100644
--- a/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
+++ b/chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
@@ -15,7 +15,6 @@
 #include "chrome/browser/chromeos/arc/intent_helper/arc_settings_service.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
-#include "chrome/common/pref_names.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/shill_profile_client.h"
@@ -175,8 +174,6 @@
 
 constexpr char kONCPacUrl[] = "http://domain.com/x";
 
-constexpr char kBackupBroadcastAction[] =
-    "org.chromium.arc.intent_helper.SET_BACKUP_ENABLED";
 constexpr char kLocationServiceBroadcastAction[] =
     "org.chromium.arc.intent_helper.SET_LOCATION_SERVICE_ENABLED";
 constexpr char kSetProxyBroadcastAction[] =
@@ -320,76 +317,7 @@
   DISALLOW_COPY_AND_ASSIGN(ArcSettingsServiceTest);
 };
 
-IN_PROC_BROWSER_TEST_F(ArcSettingsServiceTest, BackupRestorePolicyTest) {
-  PrefService* const prefs = browser()->profile()->GetPrefs();
-
-  // Set the user pref as initially enabled.
-  prefs->SetBoolean(prefs::kArcBackupRestoreEnabled, true);
-  EXPECT_TRUE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
-
-  fake_intent_helper_instance_->clear_broadcasts();
-
-  // The policy is set to false.
-  policy::PolicyMap policy;
-  policy.Set(policy::key::kArcBackupRestoreEnabled,
-             policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
-             policy::POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
-             nullptr);
-  UpdatePolicy(policy);
-
-  // The pref is disabled and managed, and the corresponding broadcast is sent
-  // at least once.
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_TRUE(prefs->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
-  base::DictionaryValue expected_broadcast_extras;
-  expected_broadcast_extras.SetBoolean("enabled", false);
-  expected_broadcast_extras.SetBoolean("managed", true);
-  EXPECT_GE(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
-                            kBackupBroadcastAction, &expected_broadcast_extras),
-            1);
-
-  fake_intent_helper_instance_->clear_broadcasts();
-
-  // The policy is set to true.
-  policy.Set(policy::key::kArcBackupRestoreEnabled,
-             policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
-             policy::POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true),
-             nullptr);
-  UpdatePolicy(policy);
-
-  // The pref is enabled and managed, and the corresponding broadcast is sent at
-  // least once.
-  EXPECT_TRUE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_TRUE(prefs->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
-  expected_broadcast_extras.SetBoolean("enabled", true);
-  EXPECT_GE(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
-                            kBackupBroadcastAction, &expected_broadcast_extras),
-            1);
-
-  fake_intent_helper_instance_->clear_broadcasts();
-
-  // The policy is unset.
-  policy.Erase(policy::key::kArcBackupRestoreEnabled);
-  UpdatePolicy(policy);
-
-  // The pref is disabled and unmanaged, and the corresponding broadcast is
-  // sent.
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_FALSE(prefs->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
-  expected_broadcast_extras.SetBoolean("enabled", false);
-  expected_broadcast_extras.SetBoolean("managed", false);
-  EXPECT_EQ(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
-                            kBackupBroadcastAction, &expected_broadcast_extras),
-            1);
-}
-
 IN_PROC_BROWSER_TEST_F(ArcSettingsServiceTest, LocationServicePolicyTest) {
-  PrefService* const prefs = browser()->profile()->GetPrefs();
-
-  // Set the user pref as initially enabled.
-  prefs->SetBoolean(prefs::kArcLocationServiceEnabled, true);
-  EXPECT_TRUE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
-
   fake_intent_helper_instance_->clear_broadcasts();
 
   // The policy is set to false.
@@ -400,14 +328,11 @@
              nullptr);
   UpdatePolicy(policy);
 
-  // The pref is disabled and managed, and the corresponding broadcast is sent
-  // at least once.
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
-  EXPECT_TRUE(prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled));
+  // The broadcast is sent which says that the pref is disabled and managed.
   base::DictionaryValue expected_broadcast_extras;
   expected_broadcast_extras.SetBoolean("enabled", false);
   expected_broadcast_extras.SetBoolean("managed", true);
-  EXPECT_GE(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
+  EXPECT_EQ(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
                             kLocationServiceBroadcastAction,
                             &expected_broadcast_extras),
             1);
@@ -421,28 +346,8 @@
              nullptr);
   UpdatePolicy(policy);
 
-  // The pref is enabled and managed, and the corresponding broadcast is sent at
-  // least once.
-  EXPECT_TRUE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
-  EXPECT_TRUE(prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled));
+  // The broadcast is sent which says that the pref is enabled and managed.
   expected_broadcast_extras.SetBoolean("enabled", true);
-  EXPECT_GE(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
-                            kLocationServiceBroadcastAction,
-                            &expected_broadcast_extras),
-            1);
-
-  fake_intent_helper_instance_->clear_broadcasts();
-
-  // The policy is unset.
-  policy.Erase(policy::key::kArcLocationServiceEnabled);
-  UpdatePolicy(policy);
-
-  // The pref is disabled and unmanaged, and the corresponding broadcast is
-  // sent.
-  EXPECT_FALSE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
-  EXPECT_FALSE(prefs->IsManagedPreference(prefs::kArcLocationServiceEnabled));
-  expected_broadcast_extras.SetBoolean("enabled", false);
-  expected_broadcast_extras.SetBoolean("managed", false);
   EXPECT_EQ(CountBroadcasts(fake_intent_helper_instance_->broadcasts(),
                             kLocationServiceBroadcastAction,
                             &expected_broadcast_extras),
diff --git a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.cc b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.cc
index 8ae3b0f..11972d6 100644
--- a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.cc
+++ b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.cc
@@ -72,26 +72,14 @@
 }
 
 void ArcOptInPreferenceHandler::SendBackupAndRestoreMode() {
-  // Override the pref default to the true value, in order to encourage users to
-  // consent with it during OptIn flow.
-  const bool enabled =
-      pref_service_->HasPrefPath(prefs::kArcBackupRestoreEnabled)
-          ? pref_service_->GetBoolean(prefs::kArcBackupRestoreEnabled)
-          : true;
   observer_->OnBackupAndRestoreModeChanged(
-      enabled,
+      pref_service_->GetBoolean(prefs::kArcBackupRestoreEnabled),
       pref_service_->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
 }
 
 void ArcOptInPreferenceHandler::SendLocationServicesMode() {
-  // Override the pref default to the true value, in order to encourage users to
-  // consent with it during OptIn flow.
-  const bool enabled =
-      pref_service_->HasPrefPath(prefs::kArcLocationServiceEnabled)
-          ? pref_service_->GetBoolean(prefs::kArcLocationServiceEnabled)
-          : true;
   observer_->OnLocationServicesModeChanged(
-      enabled,
+      pref_service_->GetBoolean(prefs::kArcLocationServiceEnabled),
       pref_service_->IsManagedPreference(prefs::kArcLocationServiceEnabled));
 }
 
diff --git a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h
index 2cc6d3b9..0d4ec31 100644
--- a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h
+++ b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h
@@ -20,10 +20,6 @@
 // observes changes there. Changes in preferences and metrics mode are passed to
 // external consumer via ArcOptInPreferenceHandlerObserver. Once started it
 // immediately sends current state of metrics mode and preferences.
-//
-// Note that the preferences and metrics mode passed by this class should only
-// be used for the OptIn flow, as this class overrides some of the defaults in
-// order to encourage users to consent with the settings.
 class ArcOptInPreferenceHandler {
  public:
   ArcOptInPreferenceHandler(ArcOptInPreferenceHandlerObserver* observer,
diff --git a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler_observer.h b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler_observer.h
index 3d121f3..56d9699 100644
--- a/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler_observer.h
+++ b/chrome/browser/chromeos/arc/optin/arc_optin_preference_handler_observer.h
@@ -10,11 +10,11 @@
 // Notifies about changes in ARC related preferences and metrics mode.
 class ArcOptInPreferenceHandlerObserver {
  public:
-  // Notifies that the metrics mode has been changed.
+  // Notifies metrics mode has been changed.
   virtual void OnMetricsModeChanged(bool enabled, bool managed) = 0;
-  // Notifies that the backup and restore mode has been changed.
+  // Notifies use backup and restore preference has been changed.
   virtual void OnBackupAndRestoreModeChanged(bool enabled, bool managed) = 0;
-  // Notifies that the location service mode has been changed.
+  // Notifies location service consent preference has been changed.
   virtual void OnLocationServicesModeChanged(bool enabled, bool managed) = 0;
 
   virtual ~ArcOptInPreferenceHandlerObserver() = default;
diff --git a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc
index 78eb27f..ce080c8d 100644
--- a/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc
+++ b/chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/macros.h"
 #include "base/memory/ptr_util.h"
 #include "base/run_loop.h"
-#include "base/values.h"
 #include "chrome/browser/chromeos/arc/arc_support_host.h"
 #include "chrome/browser/chromeos/arc/extensions/fake_arc_support.h"
 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_default_negotiator.h"
@@ -19,7 +18,6 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "components/prefs/pref_service.h"
-#include "components/sync_preferences/testing_pref_service_syncable.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -36,6 +34,8 @@
             new chromeos::FakeChromeUserManager());
 
     profile_ = base::MakeUnique<TestingProfile>();
+    profile_->GetPrefs()->SetBoolean(prefs::kArcBackupRestoreEnabled, false);
+    profile_->GetPrefs()->SetBoolean(prefs::kArcLocationServiceEnabled, false);
 
     support_host_ = base::MakeUnique<ArcSupportHost>(profile_.get());
     fake_arc_support_ = base::MakeUnique<FakeArcSupport>(support_host_.get());
@@ -51,7 +51,7 @@
     user_manager_enabler_.reset();
   }
 
-  TestingProfile* profile() { return profile_.get(); }
+  Profile* profile() { return profile_.get(); }
   ArcSupportHost* support_host() { return support_host_.get(); }
   FakeArcSupport* fake_arc_support() { return fake_arc_support_.get(); }
   ArcTermsOfServiceNegotiator* negotiator() { return negotiator_.get(); }
@@ -112,32 +112,10 @@
   EXPECT_EQ(status, Status::PENDING);
   EXPECT_EQ(fake_arc_support()->ui_page(), ArcSupportHost::UIPage::TERMS);
 
-  // By default, the preference related checkboxes are checked, despite that
-  // the preferences default to false.
-  EXPECT_FALSE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_FALSE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcLocationServiceEnabled));
-  EXPECT_TRUE(fake_arc_support()->backup_and_restore_mode());
-  EXPECT_TRUE(fake_arc_support()->location_service_mode());
-
-  // The preferences are assigned to the managed false value, and the
-  // corresponding checkboxes are unchecked.
-  profile()->GetTestingPrefService()->SetManagedPref(
-      prefs::kArcBackupRestoreEnabled, new base::Value(false));
-  EXPECT_FALSE(fake_arc_support()->backup_and_restore_mode());
-  profile()->GetTestingPrefService()->SetManagedPref(
-      prefs::kArcLocationServiceEnabled, new base::Value(false));
-  EXPECT_FALSE(fake_arc_support()->location_service_mode());
-
-  // The managed preference values are removed, and the corresponding checkboxes
-  // are checked again.
-  profile()->GetTestingPrefService()->RemoveManagedPref(
-      prefs::kArcBackupRestoreEnabled);
-  EXPECT_TRUE(fake_arc_support()->backup_and_restore_mode());
-  profile()->GetTestingPrefService()->RemoveManagedPref(
-      prefs::kArcLocationServiceEnabled);
-  EXPECT_TRUE(fake_arc_support()->location_service_mode());
+  // Check the preference related checkbox.
+  fake_arc_support()->set_metrics_mode(true);
+  fake_arc_support()->set_backup_and_restore_mode(true);
+  fake_arc_support()->set_location_service_mode(true);
 
   // Make sure preference values are not yet updated.
   EXPECT_FALSE(
@@ -157,41 +135,6 @@
       profile()->GetPrefs()->GetBoolean(prefs::kArcLocationServiceEnabled));
 }
 
-TEST_F(ArcTermsOfServiceDefaultNegotiatorTest, AcceptWithUnchecked) {
-  // Show Terms of service page.
-  Status status = Status::PENDING;
-  negotiator()->StartNegotiation(UpdateStatusCallback(&status));
-
-  // TERMS page should be shown.
-  EXPECT_EQ(status, Status::PENDING);
-  EXPECT_EQ(fake_arc_support()->ui_page(), ArcSupportHost::UIPage::TERMS);
-
-  // Override the preferences from the default values to true.
-  profile()->GetPrefs()->SetBoolean(prefs::kArcBackupRestoreEnabled, true);
-  profile()->GetPrefs()->SetBoolean(prefs::kArcLocationServiceEnabled, true);
-
-  // Uncheck the preference related checkboxes.
-  fake_arc_support()->set_backup_and_restore_mode(false);
-  fake_arc_support()->set_location_service_mode(false);
-
-  // Make sure preference values are not yet updated.
-  EXPECT_TRUE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_TRUE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcLocationServiceEnabled));
-
-  // Click the "AGREE" button so that the callback should be invoked
-  // with |agreed| = true.
-  fake_arc_support()->ClickAgreeButton();
-  EXPECT_EQ(status, Status::ACCEPTED);
-
-  // Make sure preference values are now updated.
-  EXPECT_FALSE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcBackupRestoreEnabled));
-  EXPECT_FALSE(
-      profile()->GetPrefs()->GetBoolean(prefs::kArcLocationServiceEnabled));
-}
-
 TEST_F(ArcTermsOfServiceDefaultNegotiatorTest, Cancel) {
   // Show Terms of service page.
   Status status = Status::PENDING;
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index fda3b28..daf6d39 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -4170,17 +4170,13 @@
 
 // Test ArcBackupRestoreEnabled policy.
 IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
-  PrefService* const pref = browser()->profile()->GetPrefs();
+  const PrefService* const pref = browser()->profile()->GetPrefs();
 
-  // ARC Backup & Restore is switched off by default.
-  EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+  // ARC Backup & Restore is switched on by default.
+  EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
   EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
 
-  // Switch on ARC Backup & Restore in the user prefs.
-  pref->SetBoolean(prefs::kArcBackupRestoreEnabled, true);
-  EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
-
-  // Disable ARC Backup & Restore through the policy.
+  // Disable ARC Backup & Restore.
   PolicyMap policies;
   policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
                POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
@@ -4189,7 +4185,7 @@
   EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
   EXPECT_TRUE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled));
 
-  // Enable ARC Backup & Restore through the policy.
+  // Enable ARC Backup & Restore.
   policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
                POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
                base::MakeUnique<base::FundamentalValue>(true), nullptr);
@@ -4201,7 +4197,7 @@
 // Test ArcLocationServiceEnabled policy and its interplay with the
 // DefaultGeolocationSetting policy.
 IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) {
-  PrefService* const pref = browser()->profile()->GetPrefs();
+  const PrefService* const pref = browser()->profile()->GetPrefs();
 
   // Values of the ArcLocationServiceEnabled policy to be tested.
   const std::vector<base::Value> test_policy_values = {
@@ -4217,14 +4213,6 @@
       base::FundamentalValue(3),  // 'AskGeolocation'
   };
 
-  // The pref is switched off by default.
-  EXPECT_FALSE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
-  EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
-
-  // Switch on the pref in the user prefs.
-  pref->SetBoolean(prefs::kArcLocationServiceEnabled, true);
-  EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
-
   for (const auto& test_policy_value : test_policy_values) {
     for (const auto& test_default_geo_policy_value :
          test_default_geo_policy_values) {
diff --git a/chrome/browser/resources/BUILD.gn b/chrome/browser/resources/BUILD.gn
index 1b814864..231a5063 100644
--- a/chrome/browser/resources/BUILD.gn
+++ b/chrome/browser/resources/BUILD.gn
@@ -94,7 +94,18 @@
   }
 
   grit("settings_resources") {
-    source = "settings/settings_resources.grd"
+    if (use_vulcanize) {
+      source = "settings/settings_resources_vulcanized.grd"
+      deps = [
+        "//chrome/browser/resources/settings:build",
+      ]
+      grit_flags = [
+        "-E",
+        "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
+      ]
+    } else {
+      source = "settings/settings_resources.grd"
+    }
 
     # TODO(thestig): use_qualified_include = true
     defines = chrome_grit_defines
diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn
new file mode 100644
index 0000000..8a905acd
--- /dev/null
+++ b/chrome/browser/resources/settings/BUILD.gn
@@ -0,0 +1,41 @@
+import("../vulcanize.gni")
+import("//tools/grit/grit_rule.gni")
+import("//chrome/common/features.gni")
+
+vulcanized_unbuilt = "vulcanized.unbuilt.html"
+
+vulcanize("vulcanize") {
+  host = "md-settings"
+  html_in_file = "settings.html"
+  html_out_file = vulcanized_unbuilt
+  insert_in_head = "<base href=\"chrome://\$i18n{hostname}\">"
+  input = rebase_path(root_gen_dir, root_build_dir) +
+          "/chrome/browser/resources/settings/settings_resources.pak"
+  js_out_file = "crisper.js"
+
+  deps = [
+    ":flattened_resources",
+  ]
+}
+
+polymer_css_build("build") {
+  input_files = [ vulcanized_unbuilt ]
+  output_files = [ "vulcanized.html" ]
+  deps = [
+    ":vulcanize",
+  ]
+}
+
+grit("flattened_resources") {
+  source = "settings_resources.grd"
+
+  # TODO(thestig): use_qualified_include = true
+  defines = chrome_grit_defines
+  outputs = [
+    "grit/settings_resources.h",
+    "grit/settings_resources_map.cc",
+    "grit/settings_resources_map.h",
+    "settings_resources.pak",
+  ]
+  output_dir = "$root_gen_dir/chrome/browser/resources/settings"
+}
diff --git a/chrome/browser/resources/settings/about_page/about_page.html b/chrome/browser/resources/settings/about_page/about_page.html
index 3e4f029..15aaba4 100644
--- a/chrome/browser/resources/settings/about_page/about_page.html
+++ b/chrome/browser/resources/settings/about_page/about_page.html
@@ -91,12 +91,13 @@
               <span class="product-title">$i18n{aboutProductTitle}</span>
             </div>
             <div class="settings-box two-line">
+              <!-- TODO(dpapad): Investigate why vulcanize does not handle well
+                a new line after "getIconSrc_(", causes incorrect src URL -->
               <iron-icon
                   hidden="[[!showUpdateStatus_]]"
                   icon$="[[getIcon_(
                       obsoleteSystemInfo_, currentUpdateStatusEvent_)]]"
-                  src="[[getIconSrc_(
-                      obsoleteSystemInfo_, currentUpdateStatusEvent_)]]">
+                  src="[[getIconSrc_(obsoleteSystemInfo_, currentUpdateStatusEvent_)]]">
               </iron-icon>
               <div class="start">
                 <div id="updateStatusMessage" hidden="[[!showUpdateStatus_]]"
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.html b/chrome/browser/resources/settings/languages_page/languages_page.html
index 34545a7..33580fbb 100644
--- a/chrome/browser/resources/settings/languages_page/languages_page.html
+++ b/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -171,7 +171,7 @@
                     $i18n{inputMethodEnabled}
                   </div>
                 </div>
-                <paper-icon-button icon="cr:settings"
+                <paper-icon-button icon="cr:settings_icon"
                     on-tap="onInputMethodOptionsTap_"
                     hidden="[[!item.hasOptionsPage]]">
                 </paper-icon-button>
diff --git a/chrome/browser/resources/settings/settings.html b/chrome/browser/resources/settings/settings.html
index 53975ff..2d4d4597 100644
--- a/chrome/browser/resources/settings/settings.html
+++ b/chrome/browser/resources/settings/settings.html
@@ -3,7 +3,9 @@
 <head>
   <meta charset="utf-8">
   <title>$i18n{settings}</title>
+<if expr="not use_vulcanize">
   <base href="chrome://$i18n{hostname}">
+</if>
   <link rel="import" href="chrome://resources/html/polymer.html">
   <link rel="import" href="settings_ui/settings_ui.html">
   <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd
index e9f4080..136bec8 100644
--- a/chrome/browser/resources/settings/settings_resources.grd
+++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -963,6 +963,7 @@
                  file="system_page/system_page.js"
                  type="chrome_html" />
       <structure name="IDR_SETTINGS_SETTINGS_HTML"
+                 preprocess="true"
                  file="settings.html"
                  type="chrome_html" />
       <structure name="IDR_SETTINGS_USB_DEVICES_HTML"
diff --git a/chrome/browser/resources/settings/settings_resources_vulcanized.grd b/chrome/browser/resources/settings/settings_resources_vulcanized.grd
new file mode 100644
index 0000000..4187200
--- /dev/null
+++ b/chrome/browser/resources/settings/settings_resources_vulcanized.grd
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
+  <outputs>
+    <output filename="grit/settings_resources.h" type="rc_header">
+      <emit emit_type='prepend'></emit>
+    </output>
+    <output filename="grit/settings_resources_map.cc"
+            type="resource_file_map_source" />
+    <output filename="grit/settings_resources_map.h"
+            type="resource_map_header" />
+    <output filename="settings_resources.pak" type="data_package" />
+  </outputs>
+  <release seq="1">
+    <includes>
+      <include name="IDR_MD_SETTINGS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+      <include name="IDR_MD_SETTINGS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\settings\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
+    </includes>
+  </release>
+</grit>
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc
index e5a9ae4..2cd4c0b 100644
--- a/chrome/browser/ui/webui/settings/md_settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -190,14 +190,20 @@
   // Add the metrics handler to write uma stats.
   web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>());
 
+#if BUILDFLAG(USE_VULCANIZE)
+  html_source->AddResourcePath("crisper.js", IDR_MD_SETTINGS_CRISPER_JS);
+  html_source->SetDefaultResource(IDR_MD_SETTINGS_VULCANIZED_HTML);
+  html_source->UseGzip(std::unordered_set<std::string>());
+#else
   // Add all settings resources.
   for (size_t i = 0; i < kSettingsResourcesSize; ++i) {
     html_source->AddResourcePath(kSettingsResources[i].name,
                                  kSettingsResources[i].value);
   }
+  html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML);
+#endif
 
   AddLocalizedStrings(html_source, profile);
-  html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML);
 
   content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
                                 html_source);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1b5da76..80d7234 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -6885,6 +6885,7 @@
                                      GLsizei params_size) {
   DCHECK(params);
   std::unique_ptr<GLint[]> values(new GLint[params_size]);
+  memset(values.get(), 0, params_size * sizeof(GLint));
   DoGetIntegerv(pname, values.get(), params_size);
   for (GLsizei ii = 0; ii < params_size; ++ii) {
     params[ii] = static_cast<GLboolean>(values[ii]);
@@ -6912,6 +6913,7 @@
   }
 
   std::unique_ptr<GLint[]> values(new GLint[params_size]);
+  memset(values.get(), 0, params_size * sizeof(GLint));
   DoGetIntegerv(pname, values.get(), params_size);
   for (GLsizei ii = 0; ii < params_size; ++ii) {
     params[ii] = static_cast<GLfloat>(values[ii]);
@@ -6942,6 +6944,7 @@
   }
 
   std::unique_ptr<GLint[]> values(new GLint[params_size]);
+  memset(values.get(), 0, params_size * sizeof(GLint));
   DoGetIntegerv(pname, values.get(), params_size);
   for (GLsizei ii = 0; ii < params_size; ++ii) {
     params[ii] = static_cast<GLint64>(values[ii]);
diff --git a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-expected.txt b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-expected.txt
index 0b691e5e..0b96b82a 100644
--- a/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/inspector-backend-commands-expected.txt
@@ -4,26 +4,26 @@
 commandError: then result: ["this is the error message"]
 commandArgs0: then result: [null]
 error: Protocol Error: Optional callback argument for method 'Profiler.commandArgs0' call must be a function but its type is 'number'.
-commandArgs0: catch result: {}
+commandArgs0: then result: ["Protocol Error: Optional callback argument for method 'Profiler.commandArgs0' call must be a function but its type is 'number'."]
 commandArgs1Rets0: then result: [null]
 error: Protocol Error: Optional callback argument for method 'Profiler.commandArgs1Rets0' call must be a function but its type is 'number'.
-commandArgs1Rets0: catch result: {}
+commandArgs1Rets0: then result: ["Protocol Error: Optional callback argument for method 'Profiler.commandArgs1Rets0' call must be a function but its type is 'number'."]
 error: Protocol Error: Invalid type of argument 'arg1' for method 'Profiler.commandArgs1Rets0' call. It must be 'number' but it is 'string'.
-commandArgs1Rets0: catch result: {}
+commandArgs1Rets0: then result: ["Protocol Error: Invalid type of argument 'arg1' for method 'Profiler.commandArgs1Rets0' call. It must be 'number' but it is 'string'."]
 error: Protocol Error: Invalid number of arguments for method 'Profiler.commandArgs1Rets0' call. It must have the following arguments '[{"name":"arg1","type":"number","optional":false}]'.
-commandArgs1Rets0: catch result: {}
+commandArgs1Rets0: then result: ["Protocol Error: Invalid number of arguments for method 'Profiler.commandArgs1Rets0' call. It must have the following arguments '[{\"name\":\"arg1\",\"type\":\"number\",\"optional\":false}]'."]
 commandArgs1Rets1: then result: [null,{"value1":234}]
 commandArgs1Rets1: then result: [null,{"value1":234}]
 commandArgs3Rets3: then result: [null,{},345,"alph"]
 commandArgs3Rets3: then result: [null,{},345,null]
 commandArgs3Rets3: then result: [null,{},null,"alph"]
 error: Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'.
-commandArgs3Rets3: catch result: {}
+commandArgs3Rets3: then result: ["Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'."]
 commandArgs3Rets3: then result: [null,{},null,null]
 error: Protocol Error: Invalid number of arguments for method 'Profiler.commandArgs3Rets3' call. It must have the following arguments '[{"name":"arg1","type":"object","optional":false},{"name":"arg2","type":"number","optional":true},{"name":"arg3","type":"string","optional":true}]'.
-commandArgs3Rets3: catch result: {}
+commandArgs3Rets3: then result: ["Protocol Error: Invalid number of arguments for method 'Profiler.commandArgs3Rets3' call. It must have the following arguments '[{\"name\":\"arg1\",\"type\":\"object\",\"optional\":false},{\"name\":\"arg2\",\"type\":\"number\",\"optional\":true},{\"name\":\"arg3\",\"type\":\"string\",\"optional\":true}]'."]
 error: Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'.
-commandArgs3Rets3: catch result: {}
+commandArgs3Rets3: then result: ["Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'."]
 error: Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'.
-commandArgs3Rets3: catch result: {}
+commandArgs3Rets3: then result: ["Protocol Error: Invalid type of argument 'arg2' for method 'Profiler.commandArgs3Rets3' call. It must be 'number' but it is 'string'."]
 
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 55fe154..7569593 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -510,6 +510,10 @@
 ClipRect PaintLayerClipper::backgroundClipRect(
     const ClipRectsContext& context) const {
   if (m_geometryMapper) {
+    // TODO(chrishtr): fix the underlying bug that causes this situation.
+    if (!m_layer.layoutObject().paintProperties())
+      return ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
+
     ClipRect backgroundClipRect = clipRectWithGeometryMapper(context, false);
 #ifdef CHECK_CLIP_RECTS
     ClipRect testBackgroundClipRect =
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn
index 338a75d..37721b4 100644
--- a/third_party/WebKit/Source/devtools/BUILD.gn
+++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -870,6 +870,10 @@
 
 visibility = [ "//third_party/WebKit/*" ]
 
+group("devtools_all_files") {
+  data = all_devtools_files
+}
+
 group("devtools_frontend_resources") {
   public_deps = [
     ":build_release_devtools",
diff --git a/third_party/WebKit/Source/devtools/front_end/externs.js b/third_party/WebKit/Source/devtools/front_end/externs.js
index 524ed16..e203c262 100644
--- a/third_party/WebKit/Source/devtools/front_end/externs.js
+++ b/third_party/WebKit/Source/devtools/front_end/externs.js
@@ -812,121 +812,3 @@
   /** @param {string} eventName * @param {!Function} handler */
   on: function(eventName, handler) {}
 };
-
-// Module namespaces.
-/** @type {!Object} */
-var Accessibility = {};
-/** @type {!Object} */
-var Animation = {};
-/** @type {!Object} */
-var Audits = {};
-/** @type {!Object} */
-var Audits2 = {};
-/** @type {!Object} */
-var Audits2Worker = {};
-/** @type {!Object} */
-var Bindings = {};
-/** @type {!Object} */
-var CmModes = {};
-/** @type {!Object} */
-var ColorPicker = {};
-/** @type {!Object} */
-var Common = {};
-/** @type {!Object} */
-var Components = {};
-// Closure uses Console as a namespace item so we cannot override it right now.
-var Console = {};
-/** @type {!Object} */
-var CookieTable = {};
-/** @type {!Object} */
-var CSSTracker = {};
-/** @type {!Object} */
-var DataGrid = {};
-/** @type {!Object} */
-var Devices = {};
-/** @type {!Object} */
-var Diff = {};
-/** @type {!Object} */
-var Elements = {};
-/** @type {!Object} */
-var Emulation = {};
-/** @type {!Object} */
-var Extensions = {};
-/** @type {!Object} */
-var EventListeners = {};
-/** @type {!Object} */
-var FormatterWorker = {};
-/** @type {!Object} */
-var HeapSnapshotModel = {};
-/** @type {!Object} */
-var HeapSnapshotWorker = {};
-/** @type {!Object} */
-var Host = {};
-/** @type {!Object} */
-var InlineEditor = {};
-/** @type {!Object} */
-var LayerViewer = {};
-/** @type {!Object} */
-var Layers = {};
-/** @type {!Object} */
-var Main = {};
-/** @type {!Object} */
-var Network = {};
-/** @type {!Object} */
-var NetworkConditions = {};
-/** @type {!Object} */
-var NetworkGroupLookup = {};
-/** @type {!Object} */
-var PerfUI = {};
-/** @type {!Object} */
-var Persistence = {};
-/** @type {!Object} */
-var Platform = {};
-/** @type {!Object} */
-var ProductRegistry = {};
-/** @type {!Object} */
-var Profiler = {};
-/** @type {!Object} */
-var Protocol = {};
-/** @type {!Object} */
-var QuickOpen = {};
-/** @type {!Object} */
-var Resources = {};
-/** @type {!Object} */
-var Sass = {};
-/** @type {!Object} */
-var Screencast = {};
-/** @type {!Object} */
-var SDK = {};
-/** @type {!Object} */
-var Security = {};
-/** @type {!Object} */
-var Services = {};
-/** @type {!Object} */
-var Settings = {};
-/** @type {!Object} */
-var Shell = {};
-/** @type {!Object} */
-var Snippets = {};
-/** @type {!Object} */
-var SourceFrame = {};
-/** @type {!Object} */
-var Sources = {};
-/** @type {!Object} */
-var TestRunner = {};
-/** @type {!Object} */
-var TextEditor = {};
-/** @type {!Object} */
-var Timeline = {};
-/** @type {!Object} */
-var TimelineModel = {};
-/** @type {!Object} */
-var ToolboxBootstrap = {};
-/** @type {!Object} */
-var UI = {};
-/** @type {!Object} */
-var UtilitySharedWorker = {};
-/** @type {!Object} */
-var WorkerService = {};
-/** @type {!Object} */
-var Workspace = {};
diff --git a/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js b/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
index b1266f9..e444f2d3 100644
--- a/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
+++ b/third_party/WebKit/Source/devtools/front_end/protocol/InspectorBackend.js
@@ -599,13 +599,15 @@
     }
     var userCallback = (args.length && typeof args.peekLast() === 'function') ? args.pop() : null;
     var params = this._prepareParameters(method, signature, args, !userCallback, onError);
-    if (errorMessage)
-      return Promise.reject(new Error(errorMessage));
-    else
-      return new Promise(promiseAction.bind(this));
+    var responseArguments;
+    if (errorMessage) {
+      responseArguments = [errorMessage];
+      return Promise.resolve().then(runUserCallback);
+    }
+    return new Promise(promiseAction.bind(this)).then(runUserCallback);
 
     /**
-     * @param {function(?)} resolve
+     * @param {function()} resolve
      * @param {function(!Error)} reject
      * @this {Protocol.InspectorBackend._AgentPrototype}
      */
@@ -614,11 +616,15 @@
        * @param {...*} vararg
        */
       function callback(vararg) {
-        var result = userCallback ? userCallback.apply(null, arguments) : undefined;
-        resolve(result);
+        responseArguments = arguments;
+        resolve();
       }
       this._target._wrapCallbackAndSendMessageObject(this._domain, method, params, callback);
     }
+
+    function runUserCallback() {
+      return userCallback ? userCallback.apply(null, responseArguments) : undefined;
+    }
   }
 
   /**
diff --git a/third_party/WebKit/Source/devtools/scripts/compile_frontend.py b/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
index 11b51a0a..1f11459 100755
--- a/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
+++ b/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
@@ -115,6 +115,12 @@
     'utility_shared_worker.json',
 ]
 
+skipped_namespaces = {
+    'Console',  # Closure uses Console as a namespace item so we cannot override it right now.
+    'Gonzales',  # third party module defined in front_end/externs.js
+    'Terminal',  # third party module defined in front_end/externs.js
+}
+
 
 def has_errors(output):
     return re.search(error_warning_regex, output) != None
@@ -259,7 +265,7 @@
     return errors_found
 
 
-def prepare_closure_frontend_compile(temp_devtools_path, descriptors):
+def prepare_closure_frontend_compile(temp_devtools_path, descriptors, namespace_externs_path):
     temp_frontend_path = path.join(temp_devtools_path, 'front_end')
     checker = dependency_preprocessor.DependencyPreprocessor(descriptors, temp_frontend_path, devtools_frontend_path)
     checker.enforce_dependencies()
@@ -267,6 +273,8 @@
     command = common_closure_args + [
         '--externs',
         to_platform_path(global_externs_file),
+        '--externs',
+        namespace_externs_path,
         '--js',
         runtime_file,
     ]
@@ -287,6 +295,32 @@
     return compiler_args_file.name
 
 
+def generate_namespace_externs(modules_by_name):
+    special_case_namespaces_path = path.join(path.dirname(path.abspath(__file__)), 'special_case_namespaces.json')
+    with open(special_case_namespaces_path) as json_file:
+        special_case_namespaces = json.load(json_file)
+
+    def map_module_to_namespace(module):
+        return special_case_namespaces.get(module, to_camel_case(module))
+
+    def to_camel_case(snake_string):
+        components = snake_string.split('_')
+        return ''.join(x.title() for x in components)
+
+    all_namespaces = [map_module_to_namespace(module) for module in modules_by_name]
+    namespaces = [namespace for namespace in all_namespaces if namespace not in skipped_namespaces]
+    namespaces.sort()
+    namespace_externs_file = tempfile.NamedTemporaryFile(mode='wt', delete=False)
+    try:
+        for namespace in namespaces:
+            namespace_externs_file.write('/** @type {!Object} */\n')
+            namespace_externs_file.write('var %s = {};\n' % namespace)
+    finally:
+        namespace_externs_file.close()
+    namespace_externs_path = to_platform_path(namespace_externs_file.name)
+    return namespace_externs_path
+
+
 def main():
     errors_found = False
     generate_protocol_externs.generate_protocol_externs(protocol_externs_file,
@@ -301,7 +335,8 @@
 
     print 'Compiling frontend...'
     temp_devtools_path = tempfile.mkdtemp()
-    compiler_args_file_path = prepare_closure_frontend_compile(temp_devtools_path, descriptors)
+    namespace_externs_path = generate_namespace_externs(modules_by_name)
+    compiler_args_file_path = prepare_closure_frontend_compile(temp_devtools_path, descriptors, namespace_externs_path)
     frontend_compile_proc = popen(
         java_exec + ['-jar', closure_runner_jar, '--compiler-args-file', to_platform_path_exact(compiler_args_file_path)])
 
@@ -331,6 +366,7 @@
     errors_found |= has_errors(frontend_compile_out)
 
     os.remove(protocol_externs_file)
+    os.remove(namespace_externs_path)
     os.remove(compiler_args_file_path)
     shutil.rmtree(temp_devtools_path, True)
 
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py
index d645d72..44ab18b 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff.py
@@ -50,6 +50,7 @@
         self.a_line_no = 0
         self.b_line_no = 0
         self.a_lines_len = len(a_lines)
+        self.b_lines_len = len(b_lines)
         matcher = difflib.SequenceMatcher(None, a_lines, b_lines)
         output = []
         for tag, a_start, a_end, b_start, b_end in matcher.get_opcodes():
@@ -73,7 +74,7 @@
                 output += self._format_equal_line(line)
         else:
             # Do not show context lines at the beginning of the file.
-            if self.a_line_no == 0:
+            if self.a_line_no == 0 and self.b_line_no == 0:
                 self.a_line_no += 3
                 self.b_line_no += 3
             else:
@@ -83,7 +84,7 @@
             self.b_line_no += len(common_chunk) - 6
             output += '<tr><td colspan=3>\n\n</tr>'
             # Do not show context lines at the end of the file.
-            if self.a_line_no + 3 != self.a_lines_len:
+            if self.a_line_no + 3 != self.a_lines_len or self.b_line_no + 3 != self.b_lines_len:
                 for line in common_chunk[len(common_chunk) - 3:len(common_chunk)]:
                     output += self._format_equal_line(line)
         return output
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
index fd8b67f..d0a6934 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/html_diff_unittest.py
@@ -149,3 +149,37 @@
             '<tr><th>17<th>17<td>line17\n</tr>'
             '<tr><th>18<th>18<td>line18\n</tr>'
             '<tr><td colspan=3>\n\n</tr>'))
+
+    def test_html_diff_context_at_edge(self):
+        a_lines = [
+            'line1\n',
+            'line2\n',
+            'line3\n',
+            'line4\n',
+            'line5\n',
+            'line6\n',
+            'line7\n',
+            'line8\n',
+        ]
+        b_lines = [
+            'line0\n',
+            'line1\n',
+            'line2\n',
+            'line3\n',
+            'line4\n',
+            'line5\n',
+            'line6\n',
+            'line7\n',
+            'line8\n',
+            'line9\n',
+        ]
+        self.assertEqual(HtmlDiffGenerator().generate_tbody(a_lines, b_lines), (
+            '<tr><th><th>1<td class="add">line0\n</tr>'
+            '<tr><th>1<th>2<td>line1\n</tr>'
+            '<tr><th>2<th>3<td>line2\n</tr>'
+            '<tr><th>3<th>4<td>line3\n</tr>'
+            '<tr><td colspan=3>\n\n</tr>'
+            '<tr><th>6<th>7<td>line6\n</tr>'
+            '<tr><th>7<th>8<td>line7\n</tr>'
+            '<tr><th>8<th>9<td>line8\n</tr>'
+            '<tr><th><th>10<td class="add">line9\n</tr>'))
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn
index f013b5d4..dd43b77 100644
--- a/third_party/WebKit/public/BUILD.gn
+++ b/third_party/WebKit/public/BUILD.gn
@@ -599,6 +599,12 @@
   ]
 }
 
+group("blink_devtools_frontend_resources_files") {
+  data_deps = [
+    "//third_party/WebKit/Source/devtools:devtools_all_files",
+  ]
+}
+
 group("blink_generate_devtools_grd") {
   public_deps = [
     "//third_party/WebKit/Source/devtools:generate_devtools_grd",
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids
index 300ea7d9..a946de5b 100644
--- a/tools/gritsettings/resource_ids
+++ b/tools/gritsettings/resource_ids
@@ -113,6 +113,9 @@
   "chrome/browser/resources/quota_internals_resources.grd": {
     "includes": [11990],
   },
+  "chrome/browser/resources/settings/settings_resources_vulcanized.grd": {
+    "includes": [12010],
+  },
   "chrome/browser/resources/settings/settings_resources.grd": {
     "structures": [12020],
   },
diff --git a/ui/webui/resources/cr_elements/icons.html b/ui/webui/resources/cr_elements/icons.html
index 674926d52..12af690f 100644
--- a/ui/webui/resources/cr_elements/icons.html
+++ b/ui/webui/resources/cr_elements/icons.html
@@ -50,7 +50,10 @@
       <g id="person"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"></path></g>
       <g id="print"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"></path></g>
       <g id="search"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></g>
-      <g id="settings"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"></path></g>
+      <!-- The <g> IDs are exposed as global variables in Vulcanized mode, which
+        conflicts with the "settings" namespace of MD Settings. Using an "_icon"
+        suffix prevents the naming conflict. -->
+      <g id="settings_icon"><path d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"></path></g>
       <g id="star"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></g>
       <g id="warning"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"></path></g>
     </defs>