Use <img> instead of <iron-icon> in Assistant optin

Also:
- update logic for Assistant settings.
- update timeout for loading the flow.

Bug: 866141, b/111704810, b/111796422
Test: Manual Test
Change-Id: Ibb3ba413992ee92b2e334dddeaf7d714d500ffcb
Reviewed-on: https://chromium-review.googlesource.com/1148768
Commit-Queue: Yue Li <updowndota@chromium.org>
Reviewed-by: Scott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577792}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.css
index 066db42..49ff75ba 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.css
@@ -2,29 +2,10 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file. */
 
-#main-container {
-  height: 372px;
-  overflow: hidden;
-  padding: 48px 48px 0 48px;
-  position: absolute;
-  width: 480px;
-}
-
-img {
-  display: block;
-  height: 100px;
-  margin: auto;
-}
-
 .title {
-  font-size: 18px;
   padding: 32px 0 18px 0;
 }
 
-.sub-title {
-  font-size: 12px;
-}
-
 .content {
   color: rgba(0, 0, 0, .8);
   font-size: 11px;
@@ -43,6 +24,8 @@
   padding: 10px 0 10px 0;
 }
 
-#next-button {
-  margin-inline-end: 18px;
+#confirm-reject-img {
+  display: block;
+  height: 100px;
+  margin: auto;
 }
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.html
index 3bd0ce6..3dd38a2 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_confirm_reject.html
@@ -3,20 +3,19 @@
      found in the LICENSE file. -->
 
 <link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
 <dom-module id="assistant-confirm-reject">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
     <link rel="stylesheet" href="assistant_confirm_reject.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <oobe-dialog id="confirm-reject-dialog" role="dialog" has-buttons
         hide-shadow no-footer-padding no-header android>
       <div slot="footer">
         <div id="main-container">
-          <iron-icon src="assistant_logo.png">
-          </iron-icon>
+          <img id="logo" src="assistant_logo.png">
           <div class="title" id="title-text"></div>
-          <img src="assistant_confirm_reject.svg">
+          <img id="confirm-reject-img" src="assistant_confirm_reject.svg">
           <paper-radio-group selected="accept" selectable="cr-radio-button">
             <cr-radio-button id="accept" name="accept">
               <div class="sub-title" id="accept-title-text"></div>
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.css
index c42cf84..cedf529 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.css
@@ -2,19 +2,6 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file. */
 
-#main-container {
-  height: 372px;
-  overflow: hidden;
-  padding: 48px 48px 0 48px;
-  position: absolute;
-  width: 480px;
-}
-
 .title {
-  font-size: 18px;
   padding: 32px 0 24px 0;
 }
-
-#next-button {
-  margin-inline-end: 18px;
-}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.html
index 90240b0..6e83ee2 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_get_more.html
@@ -2,17 +2,16 @@
      Use of this source code is governed by a BSD-style license that can be
      found in the LICENSE file. -->
 
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <dom-module id="assistant-get-more">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
     <link rel="stylesheet" href="assistant_get_more.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <oobe-dialog id="get-more-dialog" role="dialog" has-buttons hide-shadow
         no-footer-padding no-header android>
       <div slot="footer">
         <div id="main-container">
-          <iron-icon src="assistant_logo.png">
-          </iron-icon>
+          <img id="logo" src="assistant_logo.png">
           <div class="title" id="title-text"></div>
           <div id="insertion-point"></div>
         </div>
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.css
index a19f52d..5469665 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.css
@@ -30,12 +30,10 @@
 }
 
 .title {
-  font-size: 18px;
   padding: 32px 0 18px 0;
 }
 
 .sub-title {
-  font-size: 12px;
   padding-bottom: 8px;
 }
 
@@ -55,7 +53,3 @@
   padding: 4px 0 0 0;
   width: 100%;
 }
-
-#retry-button {
-  margin-inline-end: 18px;
-}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.html
index e4432b5..5117ec6 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.html
@@ -4,18 +4,17 @@
 
 <link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-progress.html">
 <dom-module id="assistant-loading">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
     <link rel="stylesheet" href="assistant_loading.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <oobe-dialog id="loading-dialog" role="dialog" has-buttons hide-shadow
         no-footer-padding no-header android>
       <div slot="footer">
         <div id="error-container">
-          <iron-icon src="assistant_logo.png">
-          </iron-icon>
+          <img id="logo" src="assistant_logo.png">
           <div class="title" i18n-content="assistantOptinLoadErrorTitle"></div>
           <div class="sub-title" i18n-content="assistantOptinLoadErrorMessage">
           </div>
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.js
index 181ac39..d1045cb 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.js
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_loading.js
@@ -88,7 +88,7 @@
     }.bind(this), 500);
     this.loadingTimeout_ = window.setTimeout(function() {
       this.onErrorOccurred();
-    }.bind(this), 3000);
+    }.bind(this), 10000);
   },
 
   /**
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.css
index e90691b..ca470a4 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.css
@@ -2,31 +2,17 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file. */
 
-#main-container {
-  height: 372px;
-  overflow: hidden;
-  padding: 48px 48px 0 48px;
-  position: absolute;
-  width: 480px;
-}
-
 .title {
-  font-size: 18px;
   padding-top: 32px;
 }
 
 .sub-title {
-  font-size: 12px;
   padding-top: 12px;
 }
 
-img {
+#ready-img {
   display: block;
   height: 180px;
   margin: auto;
   padding: 48px 0 0 32px;
 }
-
-#next-button {
-  margin-inline-end: 18px;
-}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.html
index 4199344..e4bff59 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_ready.html
@@ -2,20 +2,19 @@
      Use of this source code is governed by a BSD-style license that can be
      found in the LICENSE file. -->
 
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <dom-module id="assistant-ready">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
     <link rel="stylesheet" href="assistant_ready.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <oobe-dialog id="ready-dialog" role="dialog" has-buttons hide-shadow
         no-footer-padding no-header android>
       <div slot="footer">
         <div id="main-container">
-          <iron-icon src="assistant_logo.png">
-          </iron-icon>
+          <img id="logo" src="assistant_logo.png">
           <div class="title" i18n-content="assistantReadyTitle"></div>
           <div class="sub-title" i18n-content="assistantReadyMessage"></div>
-          <img src="assistant_ready.svg">
+          <img id="ready-img" src="assistant_ready.svg">
         </div>
       </div>
       <div slot="bottom-buttons" class="flex layout horizontal">
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css
new file mode 100644
index 0000000..0099ded
--- /dev/null
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_shared_styles.css
@@ -0,0 +1,28 @@
+/* Copyright 2018 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. */
+
+#main-container {
+  height: 372px;
+  overflow: hidden;
+  padding: 48px 48px 0 48px;
+  position: absolute;
+  width: 480px;
+}
+
+.title {
+  font-size: 18px;
+}
+
+.sub-title {
+  font-size: 12px;
+}
+
+#logo {
+  height: 24px;
+  margin: 0;
+}
+
+#next-button {
+  margin-inline-end: 18px;
+}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.css
index c8b764d..f39597f 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.css
@@ -2,16 +2,7 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file. */
 
-#main-container {
-  height: 372px;
-  overflow: hidden;
-  padding: 48px 48px 0 48px;
-  position: absolute;
-  width: 480px;
-}
-
 .title {
-  font-size: 18px;
   padding: 32px 0 24px 0;
 }
 
@@ -20,7 +11,3 @@
   font-size: 11px;
   padding-top: 4px;
 }
-
-#next-button {
-  margin-inline-end: 18px;
-}
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.html
index ad3b409..0633e72 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_third_party.html
@@ -2,17 +2,16 @@
      Use of this source code is governed by a BSD-style license that can be
      found in the LICENSE file. -->
 
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <dom-module id="assistant-third-party">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <link rel="stylesheet" href="assistant_third_party.css">
     <oobe-dialog id="third-party-dialog" role="dialog" has-buttons hide-shadow
         no-footer-padding no-header android>
       <div slot="footer">
         <div id="main-container">
-          <iron-icon src="assistant_logo.png">
-          </iron-icon>
+          <img id="logo" src="assistant_logo.png">
           <div class="title" id="title-text"></div>
           <div id="insertion-point"></div>
           <div id="footer">
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css
index badace0..7871756 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.css
@@ -23,12 +23,10 @@
 }
 
 .title {
-  font-size: 18px;
   padding-bottom: 10px;
 }
 
 .sub-title {
-  font-size: 12px;
   padding: 8px 0 8px 0;
 }
 
@@ -54,7 +52,6 @@
   color: rgb(66, 133, 244);
 }
 
-#more-button,
-#next-button {
+#more-button {
   margin-inline-end: 18px;
 }
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.html
index 16d5936..0134b1e 100644
--- a/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.html
+++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_value_prop.html
@@ -7,6 +7,7 @@
 <dom-module id="assistant-value-prop">
   <template>
     <link rel="stylesheet" href="../login/oobe_flex_layout.css">
+    <link rel="stylesheet" href="assistant_shared_styles.css">
     <link rel="stylesheet" href="assistant_value_prop.css">
     <oobe-dialog id="value-prop-dialog" class="value-prop-loading"
         role="dialog" has-buttons no-footer-padding no-header android>
diff --git a/chrome/browser/resources/settings/search_page/search_page.js b/chrome/browser/resources/settings/search_page/search_page.js
index 1b22969..8a66f1d 100644
--- a/chrome/browser/resources/settings/search_page/search_page.js
+++ b/chrome/browser/resources/settings/search_page/search_page.js
@@ -150,7 +150,7 @@
    */
   isAssistantTurnedOn_: function(
       arcEnabled, valuePropAccepted, assistantFeatureEnabled) {
-    return (arcEnabled || assistantFeatureEnabled) && valuePropAccepted;
+    return (arcEnabled && valuePropAccepted) || assistantFeatureEnabled;
   },
   // </if>