Open add share dialog automatically from Add Services
- When navigating to NetworkFileShares settings from the Add New Services menu in Files App, the settings should open with the Add Share dialog open. - When navigating to the NetworkFileShares settings from the settings app, the dialog should not automatically open. Bug: chromium:887134 Change-Id: Ibdc8226ff8b4c9c0695542f8045fd11d5d25818b Reviewed-on: https://chromium-review.googlesource.com/1237259 Commit-Queue: Bailey Berro <baileyberro@chromium.org> Reviewed-by: Scott Chen <scottchen@chromium.org> Reviewed-by: Zentaro Kavanagh <zentaro@chromium.org> Cr-Commit-Position: refs/heads/master@{#593773}
This commit is contained in:
chrome
browser
chromeos
smb_client
resources
settings
downloads_page
common
@ -64,7 +64,7 @@ const IconSet& SmbProvider::GetIconSet() const {
|
||||
bool SmbProvider::RequestMount(Profile* profile) {
|
||||
auto* settings_manager = chrome::SettingsWindowManager::GetInstance();
|
||||
settings_manager->ShowChromePageForProfile(
|
||||
profile, chrome::GetSettingsUrl(chrome::kSmbSharesPage));
|
||||
profile, chrome::GetSettingsUrl(chrome::kSmbSharesPageAddDialog));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ js_library("downloads_browser_proxy") {
|
||||
js_library("smb_shares_page") {
|
||||
deps = [
|
||||
":add_smb_share_dialog",
|
||||
"..:route",
|
||||
"//ui/webui/resources/js:web_ui_listener_behavior",
|
||||
]
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
|
||||
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
|
||||
<link rel="import" href="chrome://resources/html/md_select_css.html">
|
||||
<link rel="import" href="../route.html">
|
||||
<link rel="import" href="../settings_shared_css.html">
|
||||
<link rel="import" href="../settings_vars_css.html">
|
||||
<link rel="import" href="add_smb_share_dialog.html">
|
||||
|
@ -5,7 +5,10 @@
|
||||
Polymer({
|
||||
is: 'settings-smb-shares-page',
|
||||
|
||||
behaviors: [WebUIListenerBehavior],
|
||||
behaviors: [
|
||||
WebUIListenerBehavior,
|
||||
settings.RouteObserverBehavior,
|
||||
],
|
||||
|
||||
properties: {
|
||||
/**
|
||||
@ -23,6 +26,18 @@ Polymer({
|
||||
addShareResultText_: String,
|
||||
},
|
||||
|
||||
/**
|
||||
* 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';
|
||||
}
|
||||
},
|
||||
|
||||
/** @override */
|
||||
attached: function() {
|
||||
this.addWebUIListener('on-add-smb-share', this.onAddShare_.bind(this));
|
||||
|
@ -300,7 +300,7 @@ const char kInternetSubPage[] = "internet";
|
||||
const char kConnectedDevicesSubPage[] = "multidevice/features";
|
||||
const char kNetworkDetailSubPage[] = "networkDetail";
|
||||
const char kPowerSubPage[] = "power";
|
||||
const char kSmbSharesPage[] = "smbShares";
|
||||
const char kSmbSharesPageAddDialog[] = "smbShares?showAddShare=true";
|
||||
const char kStylusSubPage[] = "stylus";
|
||||
#else
|
||||
const char kCreateProfileSubPage[] = "createProfile";
|
||||
|
@ -292,6 +292,7 @@ extern const char kConnectedDevicesSubPage[];
|
||||
extern const char kNetworkDetailSubPage[];
|
||||
extern const char kPowerSubPage[];
|
||||
extern const char kSmbSharesPage[];
|
||||
extern const char kSmbSharesPageAddDialog[];
|
||||
extern const char kStylusSubPage[];
|
||||
#endif
|
||||
#if defined(OS_WIN)
|
||||
|
Reference in New Issue
Block a user