Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DriveFsBulkPinning] Add new Google Drive settings page
This is just a UI skeleton. More UI polish is required and will be introduced upon wiring it with the actual business logic. Note: the new Google Drive settings page is gated on the DriveFsBulkPinning feature, so it won't show by default. This feature flag cannot be enabled from chrome://flags. Note: Copy should be finalized and updated in 2-3 weeks from now. Bug: b:262647440 Test: Manual Change-Id: I1e22c62c35a4b2c3710dc98fe805a6c5cb41ae93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4305999 Reviewed-by: Kyle Horimoto <khorimoto@chromium.org> Commit-Queue: Marcello Salomao <msalomao@google.com> Cr-Commit-Position: refs/heads/main@{#1117353}
- Loading branch information
Marcello Salomao
authored and
Chromium LUCI CQ
committed
Mar 15, 2023
1 parent
15ace56
commit 4291168
Showing
13 changed files
with
234 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
chrome/browser/resources/settings/chromeos/os_files_page/google_drive_subpage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<style include="settings-shared"></style> | ||
|
||
<div | ||
class="settings-box two-line first" | ||
deep-link-focus-id$="[[Setting.kGoogleDriveConnection]]"> | ||
<div class="start"> | ||
<!-- TODO(b/273399125): email associated with current drive account --> | ||
$i18n{googleDriveSignedInAs} | ||
</div> | ||
<cr-button role="button"> | ||
$i18n{googleDriveDisconnectLabel} | ||
</cr-button> | ||
</div> | ||
|
||
<div class="hr"></div> | ||
|
||
<settings-toggle-button | ||
id="disconnectGoogleDriveAccount" | ||
pref="{{prefs.gdata.disabled}}" | ||
label="$i18n{googleDriveOfflineTitle}" | ||
sub-label="$i18n{googleDriveOfflineSubtitle}" | ||
deep-link-focus-id$="[[Setting.kGoogleDriveConnection]]"> | ||
</settings-toggle-button> | ||
|
||
<div class="settings-box two-line"> | ||
<div class="start"> | ||
$i18n{googleDriveOfflineClearTitle} | ||
<div class="secondary"> | ||
<!-- TODO(b/273399125): storage being used by offline files --> | ||
$i18n{googleDriveOfflineClearSubtitle} | ||
</div> | ||
</div> | ||
<cr-button role="button"> | ||
$i18n{googleDriveOfflineClearAction} | ||
</cr-button> | ||
</div> | ||
|
||
<div class="hr"></div> |
75 changes: 75 additions & 0 deletions
75
chrome/browser/resources/settings/chromeos/os_files_page/google_drive_subpage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'chrome://resources/cr_elements/cr_button/cr_button.js'; | ||
import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; | ||
import 'chrome://resources/js/action_link.js'; | ||
import 'chrome://resources/cr_elements/action_link.css.js'; | ||
import 'chrome://resources/cr_components/localized_link/localized_link.js'; | ||
import '../../settings_shared.css.js'; | ||
import '../../settings_vars.css.js'; | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {DeepLinkingMixin} from '../deep_linking_mixin.js'; | ||
import {Setting} from '../mojom-webui/setting.mojom-webui.js'; | ||
import {routes} from '../os_settings_routes.js'; | ||
import {RouteObserverMixin} from '../route_observer_mixin.js'; | ||
import {Route} from '../router.js'; | ||
|
||
import {getTemplate} from './google_drive_subpage.html.js'; | ||
|
||
const SettingsGoogleDriveSubpageElementBase = | ||
DeepLinkingMixin(RouteObserverMixin(PolymerElement)); | ||
|
||
class SettingsGoogleDriveSubpageElement extends | ||
SettingsGoogleDriveSubpageElementBase { | ||
static get is() { | ||
return 'settings-google-drive-subpage'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
/** | ||
* Preferences state. | ||
*/ | ||
prefs: { | ||
type: Object, | ||
notify: true, | ||
}, | ||
|
||
/** | ||
* Used by DeepLinkingMixin to focus this page's deep links. | ||
*/ | ||
supportedSettingIds: { | ||
type: Object, | ||
value: () => new Set<Setting>([Setting.kGoogleDriveConnection]), | ||
}, | ||
}; | ||
} | ||
|
||
prefs: object; | ||
|
||
override currentRouteChanged(route: Route, _oldRoute?: Route) { | ||
// Does not apply to this page. | ||
if (route !== routes.GOOGLE_DRIVE) { | ||
return; | ||
} | ||
|
||
this.attemptDeepLink(); | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'settings-google-drive-subpage': SettingsGoogleDriveSubpageElement; | ||
} | ||
} | ||
|
||
customElements.define( | ||
SettingsGoogleDriveSubpageElement.is, SettingsGoogleDriveSubpageElement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.