Commit 428acf5a authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

SplitSettings: Remove smb-shares-page from browser Settings.

Also removing the option about Google Drive from the same parent page.

These options are only displayed in OS Settings.

Bug: 986596
Change-Id: Ibf685aff9a3db0e6a7b81945fe81c87b07c54fee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1977200
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726695}
parent c1c4a584
...@@ -217,8 +217,7 @@ ...@@ -217,8 +217,7 @@
restamp> restamp>
<settings-section page-title="$i18n{downloadsPageTitle}" <settings-section page-title="$i18n{downloadsPageTitle}"
section="downloads"> section="downloads">
<settings-downloads-page prefs="{{prefs}}" <settings-downloads-page prefs="{{prefs}}">
page-visibility="[[pageVisibility.downloads]]">
</settings-downloads-page> </settings-downloads-page>
</settings-section> </settings-section>
</template> </template>
......
...@@ -9,9 +9,6 @@ js_type_check("closure_compile") { ...@@ -9,9 +9,6 @@ js_type_check("closure_compile") {
":downloads_browser_proxy", ":downloads_browser_proxy",
":downloads_page", ":downloads_page",
] ]
if (is_chromeos) {
deps += [ ":smb_shares_page" ]
}
} }
js_library("downloads_browser_proxy") { js_library("downloads_browser_proxy") {
...@@ -21,24 +18,10 @@ js_library("downloads_browser_proxy") { ...@@ -21,24 +18,10 @@ js_library("downloads_browser_proxy") {
] ]
} }
if (is_chromeos) {
js_library("smb_shares_page") {
deps = [
"..:route",
"../chromeos/localized_link:localized_link",
"//ui/webui/resources/cr_components/chromeos/smb_shares:smb_browser_proxy",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
}
js_library("downloads_page") { js_library("downloads_page") {
deps = [ deps = [
":downloads_browser_proxy", ":downloads_browser_proxy",
"..:page_visibility",
"..:route",
"../prefs:prefs_behavior", "../prefs:prefs_behavior",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data", "//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util", "//ui/webui/resources/js:util",
"//ui/webui/resources/js:web_ui_listener_behavior", "//ui/webui/resources/js:web_ui_listener_behavior",
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
<link rel="import" href="chrome://resources/html/util.html"> <link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../controls/controlled_button.html"> <link rel="import" href="../controls/controlled_button.html">
<link rel="import" href="../controls/settings_toggle_button.html"> <link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../prefs/prefs_behavior.html"> <link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
<link rel="import" href="downloads_browser_proxy.html"> <link rel="import" href="downloads_browser_proxy.html">
<if expr="chromeos">
<link rel="import" href="smb_shares_page.html">
</if>
<dom-module id="settings-downloads-page"> <dom-module id="settings-downloads-page">
<template> <template>
<style include="settings-shared"> <style include="settings-shared"></style>
.block { <div class="settings-box first two-line">
display: block; <div class="start settings-box-text">
} <div>$i18n{downloadLocation}</div>
</style> <div class="secondary" id="defaultDownloadPath">
<settings-animated-pages id="pages" section="downloads"
focus-config="[[focusConfig_]]">
<div route-path="default">
<div class="settings-box first two-line">
<div class="start settings-box-text">
<div>$i18n{downloadLocation}</div>
<div class="secondary" id="defaultDownloadPath">
<if expr="not chromeos"> <if expr="not chromeos">
[[prefs.download.default_directory.value]] [[prefs.download.default_directory.value]]
</if> </if>
<if expr="chromeos"> <if expr="chromeos">
[[downloadLocation_]] [[downloadLocation_]]
</if> </if>
</div>
</div> </div>
<div class="separator"></div>
<controlled-button id="changeDownloadsPath"
label="$i18n{changeDownloadLocation}"
on-click="selectDownloadLocation_"
pref="[[prefs.download.default_directory]]"
end-justified>
</controlled-button>
</div> </div>
<settings-toggle-button <div class="separator"></div>
pref="{{prefs.download.prompt_for_download}}" <controlled-button id="changeDownloadsPath"
label="$i18n{promptForDownload}"> label="$i18n{changeDownloadLocation}"
</settings-toggle-button> on-click="selectDownloadLocation_"
<if expr="chromeos"> pref="[[prefs.download.default_directory]]"
<settings-toggle-button class="continuation" end-justified>
pref="{{prefs.gdata.disabled}}" </controlled-button>
label="$i18n{disconnectGoogleDriveAccount}"
hidden="[[!pageVisibility.googleDrive]]">
</settings-toggle-button>
<cr-link-row id="smbShares" class="hr" on-click="onTapSmbShares_"
hidden="[[!pageVisibility.smbShares]]" label="$i18n{smbSharesTitle}"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
</if>
<template is="dom-if" if="[[autoOpenDownloads_]]" restamp>
<div class="settings-box">
<div class="start">
$i18n{openFileTypesAutomatically}
</div>
<div class="separator"></div>
<cr-button id="resetAutoOpenFileTypes"
on-click="onClearAutoOpenFileTypesTap_">
$i18n{clear}
</cr-button>
</div>
</template>
</div> </div>
<settings-toggle-button
<if expr="chromeos"> pref="{{prefs.download.prompt_for_download}}"
<template is="dom-if" route-path="/smbShares"> label="$i18n{promptForDownload}">
<settings-subpage </settings-toggle-button>
hidden="[[!pageVisibility.smbShares]]" <template is="dom-if" if="[[autoOpenDownloads_]]" restamp>
associated-control="[[$$('#smbShares')]]" <div class="settings-box">
page-title="$i18n{smbSharesTitle}"> <div class="start">$i18n{openFileTypesAutomatically}</div>
<settings-smb-shares-page prefs="[[prefs]]"> <div class="separator"></div>
</settings-smb-shares-page> <cr-button id="resetAutoOpenFileTypes"
</settings-subpage> on-click="onClearAutoOpenFileTypesTap_">
$i18n{clear}
</cr-button>
</div>
</template> </template>
</if>
</settings-animated-pages>
</template> </template>
<script src="downloads_page.js"></script> <script src="downloads_page.js"></script>
</dom-module> </dom-module>
...@@ -6,14 +6,6 @@ ...@@ -6,14 +6,6 @@
* @fileoverview * @fileoverview
* 'settings-downloads-page' is the settings page containing downloads * 'settings-downloads-page' is the settings page containing downloads
* settings. * settings.
*
* Example:
*
* <iron-animated-pages>
* <settings-downloads-page prefs="{{prefs}}">
* </settings-downloads-page>
* ... other pages ...
* </iron-animated-pages>
*/ */
Polymer({ Polymer({
is: 'settings-downloads-page', is: 'settings-downloads-page',
...@@ -29,12 +21,6 @@ Polymer({ ...@@ -29,12 +21,6 @@ Polymer({
notify: true, notify: true,
}, },
/**
* Dictionary defining page visibility.
* @type {!DownloadsPageVisibility}
*/
pageVisibility: Object,
/** @private */ /** @private */
autoOpenDownloads_: { autoOpenDownloads_: {
type: Boolean, type: Boolean,
...@@ -47,21 +33,6 @@ Polymer({ ...@@ -47,21 +33,6 @@ Polymer({
*/ */
downloadLocation_: String, downloadLocation_: String,
// </if> // </if>
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
value: function() {
const map = new Map();
// <if expr="chromeos">
if (settings.routes.SMB_SHARES) {
map.set(settings.routes.SMB_SHARES.path, '#smbShares');
}
// </if>
return map;
},
},
}, },
// <if expr="chromeos"> // <if expr="chromeos">
...@@ -95,11 +66,6 @@ Polymer({ ...@@ -95,11 +66,6 @@ Polymer({
}, },
// <if expr="chromeos"> // <if expr="chromeos">
/** @private */
onTapSmbShares_: function() {
settings.navigateTo(settings.routes.SMB_SHARES);
},
/** /**
* @private * @private
*/ */
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/smb_shares/add_smb_share_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/html/action_link.html">
<link rel="import" href="chrome://resources/cr_elements/action_link_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="../chromeos/localized_link/localized_link.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<dom-module id="settings-smb-shares-page">
<template>
<style include="settings-shared"></style>
<div class="settings-box first">
<div class="start">
<settings-localized-link
localized-string="$i18n{smbSharesLearnMoreLabel}"
link-url="$i18n{smbSharesLearnMoreURL}">
</settings-localized-link>
</div>
<template is="dom-if" if="[[!prefs.network_file_shares.allowed.value]]"
restamp>
<cr-policy-pref-indicator
pref="[[prefs.network_file_shares.allowed]]"
icon-aria-label="$i18n{smbSharesTitle}">
</cr-policy-pref-indicator>
</template>
<cr-button class="action-button" id="addShare"
on-click="onAddShareTap_"
disabled="[[!prefs.network_file_shares.allowed.value]]">
$i18n{addSmbShare}
</cr-button>
</div>
<template is="dom-if" if="[[showAddSmbDialog_]]" restamp>
<add-smb-share-dialog on-close="onAddSmbDialogClosed_"
last-url="[[prefs.network_file_shares.most_recently_used_url.value]]"
should-open-file-manager-after-mount
</add-smb-share-dialog>
</template>
</template>
<script src="smb_shares_page.js"></script>
</dom-module>
// 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.
Polymer({
is: 'settings-smb-shares-page',
behaviors: [
settings.RouteObserverBehavior,
],
properties: {
/**
* Preferences state.
*/
prefs: {
type: Object,
notify: true,
},
/** @private */
showAddSmbDialog_: Boolean,
},
/**
* Overridden from settings.RouteObserverBehavior.
* @param {!settings.Route} route
* @protected
*/
currentRouteChanged: function(route) {
if (route == settings.routes.SMB_SHARES) {
this.showAddSmbDialog_ =
settings.getQueryParameters().get('showAddShare') == 'true';
}
},
/** @private */
onAddShareTap_: function() {
this.showAddSmbDialog_ = true;
},
/** @private */
onAddSmbDialogClosed_: function() {
this.showAddSmbDialog_ = false;
},
});
...@@ -549,14 +549,6 @@ ...@@ -549,14 +549,6 @@
file="downloads_page/downloads_page.js" file="downloads_page/downloads_page.js"
type="chrome_html" type="chrome_html"
preprocess="true" /> preprocess="true" />
<if expr="chromeos">
<structure name="IDR_SETTINGS_SMB_SHARES_PAGE_HTML"
file="downloads_page/smb_shares_page.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_SMB_SHARES_PAGE_JS"
file="downloads_page/smb_shares_page.js"
type="chrome_html" />
</if>
<structure name="IDR_SETTINGS_I18n_SETUP_HTML" <structure name="IDR_SETTINGS_I18n_SETUP_HTML"
file="i18n_setup.html" file="i18n_setup.html"
type="chrome_html" /> type="chrome_html" />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment