diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-29 16:35:13 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-02-01 15:33:35 +0000 |
commit | c8c2d1901aec01e934adf561a9fdf0cc776cdef8 (patch) | |
tree | 9157c3d9815e5870799e070b113813bec53e0535 /chromium/ash/public | |
parent | abefd5095b41dac94ca451d784ab6e27372e981a (diff) |
BASELINE: Update Chromium to 64.0.3282.139
Change-Id: I1cae68fe9c94ff7608b26b8382fc19862cdb293a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/ash/public')
19 files changed, 499 insertions, 32 deletions
diff --git a/chromium/ash/public/cpp/BUILD.gn b/chromium/ash/public/cpp/BUILD.gn index 4992d0c54d7..0bd8246471e 100644 --- a/chromium/ash/public/cpp/BUILD.gn +++ b/chromium/ash/public/cpp/BUILD.gn @@ -5,8 +5,9 @@ import("//mojo/public/tools/bindings/mojom.gni") # C++ headers and sources that can be used outside ash. -component("ash_public_cpp") { +component("cpp") { sources = [ + "accessibility_types.h", "app_types.h", "ash_pref_names.cc", "ash_pref_names.h", @@ -49,7 +50,6 @@ component("ash_public_cpp") { "shell_window_ids.h", "stylus_utils.cc", "stylus_utils.h", - "voice_interaction_state.h", "window_pin_type.cc", "window_pin_type.h", "window_properties.cc", @@ -81,6 +81,8 @@ component("ash_public_cpp") { allow_circular_includes_from = [ "//ash/public/interfaces:interfaces_internal" ] + + output_name = "ash_public_cpp" } # Using a test service because the traits need to pass handles around. Revisit @@ -105,7 +107,7 @@ source_set("unit_tests") { ] deps = [ - ":ash_public_cpp", + ":cpp", ":test_interfaces", "//base", "//testing/gtest", diff --git a/chromium/ash/public/interfaces/BUILD.gn b/chromium/ash/public/interfaces/BUILD.gn index 7b49da5a2fe..60e07b215ac 100644 --- a/chromium/ash/public/interfaces/BUILD.gn +++ b/chromium/ash/public/interfaces/BUILD.gn @@ -4,16 +4,18 @@ import("//mojo/public/tools/bindings/mojom.gni") -# Depend upon //ash/public/cpp:ash_public_cpp, which has a public_dep on this. -# The two targets must be bundled together as the typemaps depend upon -# //ash/public/cpp, and //ash/public/cpp needs to depend on this for generated -# code (such as enums and constants). +# Depend upon //ash/public/cpp, which has a public_dep on this. The two targets +# must be bundled together as the typemaps depend upon //ash/public/cpp, +# and //ash/public/cpp needs to depend on this for generated code (such as +# enums and constants). mojom("interfaces_internal") { visibility = [ "//ash/public/cpp:*" ] sources = [ "accelerator_controller.mojom", + "accessibility_controller.mojom", "ash_display_controller.mojom", + "ash_message_center_controller.mojom", "cast_config.mojom", "constants.mojom", "event_properties.mojom", @@ -21,11 +23,12 @@ mojom("interfaces_internal") { "ime_controller.mojom", "ime_info.mojom", "locale.mojom", - "lock_screen.mojom", + "login_screen.mojom", "login_user_info.mojom", "media.mojom", "new_window.mojom", "night_light_controller.mojom", + "note_taking_controller.mojom", "pref_connector.mojom", "session_controller.mojom", "shelf.mojom", @@ -35,10 +38,13 @@ mojom("interfaces_internal") { "tray_action.mojom", "update.mojom", "user_info.mojom", + "voice_interaction_controller.mojom", "volume.mojom", "vpn_list.mojom", "wallpaper.mojom", + "window_actions.mojom", "window_pin_type.mojom", + "window_properties.mojom", "window_state_type.mojom", "window_style.mojom", ] @@ -51,6 +57,7 @@ mojom("interfaces_internal") { "//skia/public/interfaces", "//ui/events/mojo:interfaces", "//ui/gfx/image/mojo:interfaces", + "//ui/message_center/mojo:mojo", ] component_output_prefix = "ash_public_interfaces_internal" @@ -62,6 +69,7 @@ mojom("interfaces_internal") { mojom("test_interfaces") { testonly = true sources = [ + "shelf_test_api.mojom", "system_tray_test_api.mojom", ] deps = [ diff --git a/chromium/ash/public/interfaces/accessibility_controller.mojom b/chromium/ash/public/interfaces/accessibility_controller.mojom new file mode 100644 index 00000000000..c73f7a667c5 --- /dev/null +++ b/chromium/ash/public/interfaces/accessibility_controller.mojom @@ -0,0 +1,50 @@ +// 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. + +module ash.mojom; + +// Alert sent to the accessibility api. +enum AccessibilityAlert { + // Default value, indicates no accessibility alert. + NONE, + + // When caps lock is turned on. + CAPS_ON, + + // When caps lock is turned off. + CAPS_OFF, + + // When screen is turned on by tablet power button. + SCREEN_ON, + + // When screen is turned off by tablet power button. + SCREEN_OFF, + + // When window moved to above/below/left/right display by accelerators. + WINDOW_MOVED_TO_ABOVE_DISPLAY, + WINDOW_MOVED_TO_BELOW_DISPLAY, + WINDOW_MOVED_TO_LEFT_DISPLAY, + WINDOW_MOVED_TO_RIGHT_DISPLAY, + + // When the user attempts a keyboard command that requires a window to work, + // and none is available. + WINDOW_NEEDED, + + // When the user enters window overview mode. + WINDOW_OVERVIEW_MODE_ENTERED +}; + +// Interface for ash client (e.g. Chrome) to control and query accessibility +// features. +interface AccessibilityController { + // Sets the client interface. + SetClient(AccessibilityControllerClient client); +}; + +// Interface for ash to request accessibility service from its client (e.g. +// Chrome). +interface AccessibilityControllerClient { + // Triggers an accessibility alert to give the user feedback. + TriggerAccessibilityAlert(AccessibilityAlert alert); +}; diff --git a/chromium/ash/public/interfaces/ash_message_center_controller.mojom b/chromium/ash/public/interfaces/ash_message_center_controller.mojom new file mode 100644 index 00000000000..f42ce2c4033 --- /dev/null +++ b/chromium/ash/public/interfaces/ash_message_center_controller.mojom @@ -0,0 +1,71 @@ +// 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. + +module ash.mojom; + +import "ui/gfx/image/mojo/image.mojom"; +import "ui/message_center/mojo/notification.mojom"; +import "ui/message_center/mojo/notifier_id.mojom"; +import "mojo/common/string16.mojom"; + +// A struct that contains information for presenting a notifier in a settings +// panel. +struct NotifierUiData { + // The notifier (e.g. an extension). + message_center.mojom.NotifierId notifier_id; + + // The user-visible name of the notifier (e.g. an extension's name). + mojo.common.mojom.String16 name; + + // True if the notifier has a button for advanced settings/"learn more". + bool has_advanced_settings; + + // True if notifications from the notifier are presently enabled. + bool enabled; + + // An icon displayed next to the name. + gfx.mojom.ImageSkia? icon; +}; + +// The message center controller funnels notification requests from the client +// to the MessageCenter. +interface AshMessageCenterController { + SetClient(associated AshMessageCenterClient client); + + ShowClientNotification(message_center.mojom.Notification notification); + + UpdateNotifierIcon(message_center.mojom.NotifierId notifier_id, + gfx.mojom.ImageSkia icon); + + NotifierEnabledChanged(message_center.mojom.NotifierId notifier_id, + bool enabled); +}; + +// The message center client interface mimics +// message_center::NotificationDelegate. The ID strings match the id passed in +// |notification| in ShowClientNotification and the format of the ID is up to +// the client. +interface AshMessageCenterClient { + // Called when a notification previously displayed by the client is closed. + HandleNotificationClosed(string id, bool by_user); + + // Called when the body of a notification is clicked. + HandleNotificationClicked(string id); + + // Called when a notification that has buttons (e.g., "Learn more") receives a + // click on one of the buttons. + HandleNotificationButtonClicked(string id, int32 button_index); + + // Called when a user enables or disables notifications from the given + // notifier. + SetNotifierEnabled(message_center.mojom.NotifierId notifier_id, bool enabled); + + // Called when the advanced settings button is pressed for a notifier. + HandleNotifierAdvancedSettingsRequested( + message_center.mojom.NotifierId notifier_id); + + // Asks the client for a list of notifiers and associated UI information to be + // displayed in a settings panel. + GetNotifierList() => (array<NotifierUiData> notifiers); +}; diff --git a/chromium/ash/public/interfaces/cast_config.mojom b/chromium/ash/public/interfaces/cast_config.mojom index 3a6392639c3..72b4e8e9d2b 100644 --- a/chromium/ash/public/interfaces/cast_config.mojom +++ b/chromium/ash/public/interfaces/cast_config.mojom @@ -4,10 +4,25 @@ module ash.mojom; +// The type of icon the sink is associated with. These values match +// media_router::SinkIconType. +enum SinkIconType { + CAST = 0, + CAST_AUDIO_GROUP = 1, + CAST_AUDIO = 2, + MEETING = 3, + HANGOUT = 4, + EDUCATION = 5, + GENERIC = 6 +}; + struct CastSink { string id; string name; string domain; + + // Icon which describes the type of sink media is being routed to. + SinkIconType sink_icon_type = SinkIconType.GENERIC; }; enum ContentSource { diff --git a/chromium/ash/public/interfaces/highlighter_controller.mojom b/chromium/ash/public/interfaces/highlighter_controller.mojom index fc679f56bb9..4a643d01f9b 100644 --- a/chromium/ash/public/interfaces/highlighter_controller.mojom +++ b/chromium/ash/public/interfaces/highlighter_controller.mojom @@ -12,6 +12,9 @@ import "ui/gfx/geometry/mojo/geometry.mojom"; interface HighlighterController { // Sets the client interface. SetClient(HighlighterControllerClient client); + + // Exits the highlighter mode if it is currently enabled. + ExitHighlighterMode(); }; // Interface for ash to notify the client (e.g. Chrome) about the highlighter diff --git a/chromium/ash/public/interfaces/lock_screen.mojom b/chromium/ash/public/interfaces/login_screen.mojom index 5a5155b8024..91da5e10b5a 100644 --- a/chromium/ash/public/interfaces/lock_screen.mojom +++ b/chromium/ash/public/interfaces/login_screen.mojom @@ -9,10 +9,11 @@ import "components/proximity_auth/public/interfaces/auth_type.mojom"; import "components/signin/public/interfaces/account_id.mojom"; import "mojo/common/string16.mojom"; -// Allows clients (e.g. Chrome browser) to control the ash lock screen. -interface LockScreen { +// Allows clients (e.g. Chrome browser) to control the ash login/lock/user-add +// screens. +interface LoginScreen { // Sets the client interface. - SetClient(LockScreenClient client); + SetClient(LoginScreenClient client); // Displays the lock screen. |did_show| is true iff the lock UI was // successfully displayed. @@ -37,7 +38,7 @@ interface LockScreen { // |account_id|: The account id of the user in the user pod. // |icon|: Information regarding the icon. ShowUserPodCustomIcon(signin.mojom.AccountId account_id, - UserPodCustomIconOptions icon); + EasyUnlockIconOptions icon); // Requests to hide the custom icon in the user pod. // |account_id|: The account id of the user in the user pod. @@ -65,11 +66,19 @@ interface LockScreen { // Requests focus to be handed off to the next suitable widget. // |reverse|: Whether the tab order is reversed. HandleFocusLeavingLockScreenApps(bool reverse); + + // Called when the info shown for dev and canary channels are changed. + // |os_version_label_text|: The OS version. + // |enterprise_info_text|: The enterprise info. + // |bluetooth_name|: The name of the bluetooth adapter. + SetDevChannelInfo(string os_version_label_text, + string enterprise_info_text, + string bluetooth_name); }; // Allows ash lock screen to control a client (e.g. Chrome browser). Requests // often involve preferences or talk to cryptohome that is not available to ash. -interface LockScreenClient { +interface LoginScreenClient { // Request user authentication in chrome. // If auth succeeds: // chrome will hide the lock screen and clear any displayed error messages. diff --git a/chromium/ash/public/interfaces/login_user_info.mojom b/chromium/ash/public/interfaces/login_user_info.mojom index 36e1daa5019..15779c24405 100644 --- a/chromium/ash/public/interfaces/login_user_info.mojom +++ b/chromium/ash/public/interfaces/login_user_info.mojom @@ -17,13 +17,52 @@ enum MultiProfileUserBehavior { OWNER_PRIMARY_ONLY = 3, }; +// Easy unlock icon choices. +enum EasyUnlockIconId { + // No icon shown. + NONE, + // The user has clicked the easy unlock icon and disabled easy unlock for this + // login/lock session. + HARDLOCKED, + // Phone could not be found. + LOCKED, + // Phone found, but it is not unlocked. + LOCKED_TO_BE_ACTIVATED, + // Phone found, but it is too far away. + LOCKED_WITH_PROXIMITY_HINT, + // Phone found and unlocked. The user can click to dismiss the login/lock + // screen. + UNLOCKED, + // Scanning for phone. + SPINNER, +}; + // Information about the custom icon in the user pod. -struct UserPodCustomIconOptions { - string id; +struct EasyUnlockIconOptions { + // Icon that should be displayed. + EasyUnlockIconId icon; + // Tooltip that is associated with the icon. This is shown automatically if + // |autoshow_tooltip| is true. The user can always see the tooltip if they + // hover over the icon. The tooltip should be used for the accessibility label + // if it is present. mojo.common.mojom.String16 tooltip; + // If true, the tooltip should be displayed (even if the user is not currently + // hovering over the icon, ie, this makes |tooltip| act like a little like a + // notification). bool autoshow_tooltip; + // Accessibility label. Only used if |tooltip| is empty. + // TODO(jdufault): Always populate and use |aria_label|, even if |tooltip| is + // non-empty. mojo.common.mojom.String16 aria_label; + // If true, clicking the easy unlock icon should fire a hardlock event which + // will disable easy unlock. The hardlock event will request a new icon + // display via a separate EasyUnlockIconsOption update. See + // login_screen.mojom::HardlockPod. bool hardlock_on_click; + // If true, the lock screen is being demoed so the user can test out easy + // unlock. The flow operates as normal. Hardlocking is disabled in this + // scenario. + // TODO(jdufault): This should be removed, as it does not change UI. bool is_trial_run; }; diff --git a/chromium/ash/public/interfaces/note_taking_controller.mojom b/chromium/ash/public/interfaces/note_taking_controller.mojom new file mode 100644 index 00000000000..a97e33373c2 --- /dev/null +++ b/chromium/ash/public/interfaces/note_taking_controller.mojom @@ -0,0 +1,19 @@ +// 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. + +module ash.mojom; + +// Interface for ash client (e.g. Chrome) to connect to the note taking +// controller. +interface NoteTakingController { + // Sets the client interface. + SetClient(NoteTakingControllerClient client); +}; + +// Interface for ash to notify the client (e.g. Chrome) about the new note +// creation. +interface NoteTakingControllerClient { + // Called when the controller needs to create a new note. + CreateNote(); +};
\ No newline at end of file diff --git a/chromium/ash/public/interfaces/shelf.mojom b/chromium/ash/public/interfaces/shelf.mojom index e2ecf4fc075..58d155afeb1 100644 --- a/chromium/ash/public/interfaces/shelf.mojom +++ b/chromium/ash/public/interfaces/shelf.mojom @@ -33,7 +33,6 @@ enum ShelfAction { enum ShelfItemStatus { CLOSED, // A closed shelf item, i.e. has no live instance. RUNNING, // A shelf item that has live instance. - ACTIVE, // An active shelf item that has focus. ATTENTION, // A shelf item that needs user's attention. }; diff --git a/chromium/ash/public/interfaces/shelf_test_api.mojom b/chromium/ash/public/interfaces/shelf_test_api.mojom new file mode 100644 index 00000000000..57040fcea1c --- /dev/null +++ b/chromium/ash/public/interfaces/shelf_test_api.mojom @@ -0,0 +1,22 @@ +// 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. + +module ash.mojom; + +// All methods operate on the shelf on the primary display. +interface ShelfTestApi { + // Returns true if the shelf is visible (e.g. not auto-hidden). + IsVisible() => (bool visible); + + // Forces a visibility update and then runs the callback. + UpdateVisibility() => (); + + // Returns true if a window is overlapping the shelf, which changes its + // appearance slightly. + HasOverlappingWindow() => (bool overlap); + + // Returns true if the shelf alignment is BOTTOM_LOCKED, which is not exposed + // via prefs. + IsAlignmentBottomLocked() => (bool locked); +}; diff --git a/chromium/ash/public/interfaces/system_tray.mojom b/chromium/ash/public/interfaces/system_tray.mojom index 4c5571e00e6..3f5dffd1d17 100644 --- a/chromium/ash/public/interfaces/system_tray.mojom +++ b/chromium/ash/public/interfaces/system_tray.mojom @@ -122,6 +122,9 @@ interface SystemTrayClient { // connection (e.g. Cisco AnyConnect). ShowThirdPartyVpnCreate(string extension_id); + // Launches Arc VPN provider. + ShowArcVpnCreate(string app_id); + // Shows settings related to networking. If |network_id| is empty, shows // general settings. Otherwise shows settings for the individual network. // On devices |network_id| is a GUID, but on Linux desktop and in tests it can diff --git a/chromium/ash/public/interfaces/system_tray_test_api.mojom b/chromium/ash/public/interfaces/system_tray_test_api.mojom index c46bba08749..9ac668b0356 100644 --- a/chromium/ash/public/interfaces/system_tray_test_api.mojom +++ b/chromium/ash/public/interfaces/system_tray_test_api.mojom @@ -15,6 +15,14 @@ enum TrayItem { // All methods operate on the system tray on the primary display. interface SystemTrayTestApi { + // Disables animations (e.g. the tray view icon slide-in). + DisableAnimations() => (); + + // Returns true if the view exists and is visible in the system tray area + // at the bottom of the screen. Usually these views are icons, like the Wi-Fi + // or battery icon. + IsTrayViewVisible(int32 view_id) => (bool visible); + // Shows the system tray bubble menu. ShowBubble() => (); @@ -27,4 +35,11 @@ interface SystemTrayTestApi { // Returns the tooltip for a bubble view, or the empty string if the view // does not exist. GetBubbleViewTooltip(int32 view_id) => (mojo.common.mojom.String16 tooltip); + + // Returns the label for a bubble view, or the empty string if the view does + // not exist. The view must be a views::Label. + GetBubbleLabelText(int32 view_id) => (mojo.common.mojom.String16 tooltip); + + // Returns true if the clock is using 24 hour time. + Is24HourClock() => (bool is_24_hour); }; diff --git a/chromium/ash/public/interfaces/tray_action.mojom b/chromium/ash/public/interfaces/tray_action.mojom index 49f40c5babf..4e08e4831b9 100644 --- a/chromium/ash/public/interfaces/tray_action.mojom +++ b/chromium/ash/public/interfaces/tray_action.mojom @@ -19,11 +19,6 @@ enum TrayActionState { // The client is currently handling the action. kActive, - - // The client is currently handling the action, but in background (e.g. the - // handler window for the lock screen action was moved to the background and - // appears underneath the login user pods). - kBackground, }; // The user action that triggered a request for a new note. diff --git a/chromium/ash/public/interfaces/voice_interaction_controller.mojom b/chromium/ash/public/interfaces/voice_interaction_controller.mojom new file mode 100644 index 00000000000..56c73f81901 --- /dev/null +++ b/chromium/ash/public/interfaces/voice_interaction_controller.mojom @@ -0,0 +1,66 @@ +// 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. + +module ash.mojom; + +// There is another copy of the VoiceInteractionState definition in +// //components/arc/common/voice_interaction_framework.mojom +// Please also update the other one if you change it. +// The duplicate definition is because we do not use extensible widely +// (crbug.com/731893). + +// The initial state is NOT_READY, then it will either becomes STOPPED or +// RUNNING. If the mojo connection is lost, the state will be set back to +// NOT_READY. +enum VoiceInteractionState { + // Voice interaction service is not ready yet, request sent will be waiting. + NOT_READY = 0, + // Voice interaction session is stopped. + STOPPED, + // Voice interaction session is currently running. + RUNNING +}; + +enum AssistantAllowedState { + // Assistant feature is allowed. + ALLOWED = 0, + // Disallowed because ARC++ is disallowed. There could be many specific + // reasones why ARC++ is disallowed. This enum is a catch all. Some enums + // below will show specific reasons. + DISALLOWED_BY_ARC_DISALLOWED, + // Disallowed because ARC++ is disabled by policy. + DISALLOWED_BY_ARC_POLICY, + // Disallowed because user's locale is not compatible. + DISALLOWED_BY_LOCALE, + // Disallowed because the feature flag is off. + DISALLOWED_BY_FLAG, + // Disallowed because current user is not primary user. + DISALLOWED_BY_NONPRIMARY_USER, + // Disallowed because current user is supervised user. + DISALLOWED_BY_SUPERVISED_USER, + // Disallowed because incognito mode. + DISALLOWED_BY_INCOGNITO +}; + +// Interface for ash client (Chrome) to connect to the voice interaction +// controller, which notifies changes of voice interaction related flags. +interface VoiceInteractionController { + // Called when the voice interaction state is changed. + NotifyStatusChanged(VoiceInteractionState state); + + // Called when the voice interaction settings is enabled/disabled. + NotifySettingsEnabled(bool enabled); + + // Called when the voice interaction context is enabled/disabled. + // If context is enabled the screenshot will be passed in voice + // interaction session. + NotifyContextEnabled(bool enabled); + + // Called when the voice interaction setup complete status is changed. + NotifySetupCompleted(bool completed); + + // Notify if voice interaction feature is allowed or not. e.g. not allowed + // if disabled by policy. + NotifyFeatureAllowed(AssistantAllowedState state); +}; diff --git a/chromium/ash/public/interfaces/vpn_list.mojom b/chromium/ash/public/interfaces/vpn_list.mojom index dd7954330a4..3c030fe527c 100644 --- a/chromium/ash/public/interfaces/vpn_list.mojom +++ b/chromium/ash/public/interfaces/vpn_list.mojom @@ -4,17 +4,43 @@ module ash.mojom; +import "mojo/common/time.mojom"; + // Describes a third-party VPN provided by an extension (e.g. Cisco AnyConnect). struct ThirdPartyVpnProvider { string name; string extension_id; }; +// Describes an Arc VPN provider. last_launch_time is used to sort the list of +// Arc VPN providers. +struct ArcVpnProvider { + // Unique android package name of the Arc VPN provider. e.g. vpn.app.package + string package_name; + // App name of Arc VPN provider. e.g. VPNapp + string app_name; + // Unique app id for launching the app. e.g. pbmkokpdlpfmapoiccpblbmjjhhabjaa + string app_id; + // Last launch time of the Arc VPN provider. + mojo.common.mojom.Time last_launch_time; +}; + // Manages the VPN provider list in ash. Allows extension-backed VPN providers // to be added. Ash handles the built-in OpenVPN / L2TP provider internally. +// Allows Arc VPN providers to be added and removed, updates providers' launch +// time so that they are shown in LRU order, updates providers' name change. interface VpnList { // Sets the list of third-party VPN providers. The |providers| array may be // empty to clear the list (e.g. after the last third-party VPN extension is // uninstalled). SetThirdPartyVpnProviders(array<ThirdPartyVpnProvider> providers); + + // Sets the list of Arc VPN providers. + SetArcVpnProviders(array<ArcVpnProvider> arc_providers); + + // Adds or updates an Arc VPN provider. + AddOrUpdateArcVPNProvider(ArcVpnProvider arc_provider); + + // Removes an Arc VPN provider. + RemoveArcVPNProvider(string package_name); }; diff --git a/chromium/ash/public/interfaces/wallpaper.mojom b/chromium/ash/public/interfaces/wallpaper.mojom index d368fe9a2be..3db509c80ac 100644 --- a/chromium/ash/public/interfaces/wallpaper.mojom +++ b/chromium/ash/public/interfaces/wallpaper.mojom @@ -4,8 +4,12 @@ module ash.mojom; +import "ash/public/interfaces/user_info.mojom"; +import "components/signin/public/interfaces/account_id.mojom"; +import "mojo/common/file_path.mojom"; import "mojo/common/time.mojom"; import "skia/public/interfaces/bitmap.mojom"; +import "url/mojo/url.mojom"; // These values match wallpaper::WallpaperLayout. enum WallpaperLayout { @@ -26,6 +30,9 @@ enum WallpaperType { DEVICE, }; +// TODO(crbug.com/776464): Remove this after WallpaperManager is removed. +// WallpaperInfo will be an internal concept within WallpaperController. +// // This corresponds to wallpaper::WallpaperInfo. struct WallpaperInfo { string location; @@ -34,25 +41,118 @@ struct WallpaperInfo { mojo.common.mojom.Time date; }; +// User info needed to set wallpapers. Clients must specify the user because +// it's not always the same with the active user, e.g., when showing wallpapers +// for different user pods at login screen, or setting wallpapers selectively +// for primary user and active user during a multi-profile session. +struct WallpaperUserInfo { + // The user's account id. + signin.mojom.AccountId account_id; + + // The user type. Matches user_manager::UserType. + UserType type; + + // True if the user's non-cryptohome data (wallpaper, avatar etc.) is + // ephemeral. See |UserManager::IsCurrentUserNonCryptohomeDataEphemeral| for + // more details. + bool is_ephemeral; + + // True if the user has gaia account. + bool has_gaia_account; +}; + // Used by Chrome to set the wallpaper displayed by ash. interface WallpaperController { - // Calling this method triggers an initial notification of the wallpaper - // state. Observers are automatically removed as their connections are closed. - AddObserver(associated WallpaperObserver observer); + // Sets the client interface. + SetClient(WallpaperControllerClient client); + + // Sets wallpaper from policy or from a local file. Saves the custom wallpaper + // to file, posts task to generate thumbnail and updates local state. + // |user_info|: The user's information related to wallpaper. + // |wallpaper_files_id|: The unique id of each wallpaper file. + // |file_name|: The name of the wallpaper file. + // |layout|: The layout of the wallpaper, used for wallpaper resizing. + // |type|: The type of the wallpaper, e.g., default, policy etc. + // |image|: The wallpaper image. + // |show_wallpaper|: If false, don't show the new wallpaper now but only + // update cache. + SetCustomWallpaper(WallpaperUserInfo user_info, + string wallpaper_files_id, + string file_name, + WallpaperLayout layout, + WallpaperType type, + skia.mojom.Bitmap image, + bool show_wallpaper); + + // Sets wallpaper from the wallpaper picker selection, i.e., the wallpaper + // type is ONLINE. + // |user_info|: The user's information related to wallpaper. + // |image|: The wallpaper image. + // |url|: The url corresponding to this wallpaper. Used as a placeholder for + // the location in WallpaperInfo. + // |layout|: The layout of the wallpaper, used for wallpaper resizing. + // |show_wallpaper|: If false, don't show the new wallpaper now but only + // update cache. + SetOnlineWallpaper(WallpaperUserInfo user_info, + skia.mojom.Bitmap image, + string url, + WallpaperLayout layout, + bool show_wallpaper); + + // Sets the user's wallpaper to be the default wallpaper. Note: different user + // types may have different default wallpapers. If |show_wallpaper| is false, + // don't show the default wallpaper now. + SetDefaultWallpaper(WallpaperUserInfo user_info, bool show_wallpaper); - // Set the wallpaper picker interface, to let ash trigger Chrome's picker. - SetWallpaperPicker(WallpaperPicker picker); + // Sets a customized default wallpaper to be used wherever a default wallpaper + // is needed. Note: it doesn't change the default wallpaper for guest and + // child accounts. + // |wallpaper_url|: The url corresponding to this wallpaper. + // |file_path|: The path of the wallpaper file. + // |resized_directory|: The directory where resized versions are stored. Must + // be writable. + SetCustomizedDefaultWallpaper(url.mojom.Url wallpaper_url, + mojo.common.mojom.FilePath file_path, + mojo.common.mojom.FilePath resized_directory); + // Shows the user's wallpaper, which is determined in the following order: + // 1) Use device policy wallpaper if it exists AND we are at the login screen. + // 2) Use user policy wallpaper if it exists. + // 3) Use the wallpaper set by the user (either by |SetOnlineWallpaper| or + // |SetCustomWallpaper|), if any. + // 4) Use the default wallpaper of this user. + ShowUserWallpaper(WallpaperUserInfo user_info); + + // Used by the gaia-signin UI. Signin wallpaper is considered either as the + // device policy wallpaper or the default wallpaper. + ShowSigninWallpaper(); + + // Removes all of the user's saved wallpapers and related info. + RemoveUserWallpaper(WallpaperUserInfo user_info); + + // TODO(crbug.com/776464): This is only used by WallpaperManager. Remove this + // after WallpaperManager is removed. + // // Set the wallpaper bitmap and info used for the ash desktop background. // A null or empty |wallpaper| bitmap is treated as a no-op. // TODO(crbug.com/655875): Optimize ash wallpaper transport; avoid sending // large bitmaps over Mojo; use shared memory like BitmapUploader, etc. SetWallpaper(skia.mojom.Bitmap? wallpaper, WallpaperInfo info); + // Calling this method triggers an initial notification of the wallpaper + // state. Observers are automatically removed as their connections are closed. + AddObserver(associated WallpaperObserver observer); + // Runs to get wallpaper prominent colors. GetWallpaperColors() => (array<uint32> prominent_colors); }; +// Used by ash to control a Chrome client. +interface WallpaperControllerClient { + // Opens the wallpaper picker window. + OpenWallpaperPicker(); +}; + // Used to listen for wallpaper state changed. interface WallpaperObserver { // Called when the colors extracted from the current wallpaper change. May @@ -61,9 +161,3 @@ interface WallpaperObserver { // Colors are ordered and are referenced in wallpaper::ColorProfileType. OnWallpaperColorsChanged(array<uint32> prominent_colors); }; - -// Used by ash to trigger Chrome's wallpaper picker functionality. -interface WallpaperPicker { - // Open the wallpaper picker window. - Open(); -}; diff --git a/chromium/ash/public/interfaces/window_actions.mojom b/chromium/ash/public/interfaces/window_actions.mojom new file mode 100644 index 00000000000..1caa15b71b9 --- /dev/null +++ b/chromium/ash/public/interfaces/window_actions.mojom @@ -0,0 +1,10 @@ +// 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. + +module ash.mojom; + +// The multiprofile mode in chromeos performs tricks with window visibility +// which require manually notifying the tablet mode controller that a window +// should be considered visible. +const string kAddWindowToTabletMode = "ash:add-window-to-tablet-mode"; diff --git a/chromium/ash/public/interfaces/window_properties.mojom b/chromium/ash/public/interfaces/window_properties.mojom new file mode 100644 index 00000000000..af14f4fcf6a --- /dev/null +++ b/chromium/ash/public/interfaces/window_properties.mojom @@ -0,0 +1,21 @@ +// 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. + +module ash.mojom; + +// V1 apps can intercept system keys. This will let the app handle F-keys instead +// of the window manager. +const string kCanConsumeSystemKeys_Property = + "ash:can-consume-system-keys"; + +// True if the shelf should be hidden when this window is put into fullscreen. +// Exposed because some windows want to explicitly opt-out of this. +const string kHideShelfWhenFullscreen_Property = + "ash:hide-shelf-when-fullscreen"; + +// This is put on windows to indicate that ash should perform auto management of +// window positions; when you open a second browser, ash will move the two to +// minimize overlap. +const string kWindowPositionManaged_Property = + "ash:window-position-managed"; |