| // Copyright (c) 2012 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. |
| |
| #ifndef ASH_SHELL_DELEGATE_H_ |
| #define ASH_SHELL_DELEGATE_H_ |
| |
| #include <memory> |
| #include <string> |
| |
| #include "ash/ash_export.h" |
| #include "base/callback.h" |
| #include "base/strings/string16.h" |
| #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom-forward.h" |
| #include "mojo/public/cpp/bindings/pending_receiver.h" |
| #include "services/device/public/mojom/bluetooth_system.mojom-forward.h" |
| #include "services/device/public/mojom/fingerprint.mojom-forward.h" |
| #include "services/media_session/public/cpp/media_session_service.h" |
| #include "ui/gfx/native_widget_types.h" |
| |
| namespace aura { |
| class Window; |
| } |
| |
| namespace ui { |
| class OSExchangeData; |
| } |
| |
| namespace ash { |
| |
| class AccessibilityDelegate; |
| class CaptureModeDelegate; |
| class ScreenshotDelegate; |
| class BackGestureContextualNudgeDelegate; |
| class BackGestureContextualNudgeController; |
| class NearbyShareController; |
| class NearbyShareDelegate; |
| |
| // Delegate of the Shell. |
| class ASH_EXPORT ShellDelegate { |
| public: |
| // The Shell owns the delegate. |
| virtual ~ShellDelegate() = default; |
| |
| // Returns true if |window| can be shown for the delegate's concept of current |
| // user. |
| virtual bool CanShowWindowForUser(const aura::Window* window) const = 0; |
| |
| // Creates and returns the delegate of the Capture Mode feature. |
| virtual std::unique_ptr<CaptureModeDelegate> CreateCaptureModeDelegate() |
| const = 0; |
| |
| // Creates the screenshot delegate, which has dependencies on //chrome. |
| virtual std::unique_ptr<ScreenshotDelegate> CreateScreenshotDelegate() = 0; |
| |
| // Creates a accessibility delegate. Shell takes ownership of the delegate. |
| virtual AccessibilityDelegate* CreateAccessibilityDelegate() = 0; |
| |
| // Creates a back gesture contextual nudge delegate for |controller|. |
| virtual std::unique_ptr<BackGestureContextualNudgeDelegate> |
| CreateBackGestureContextualNudgeDelegate( |
| BackGestureContextualNudgeController* controller) = 0; |
| |
| virtual std::unique_ptr<NearbyShareDelegate> CreateNearbyShareDelegate( |
| NearbyShareController* controller) const = 0; |
| |
| // Notifies the browser that there was a change in the state for desks and now |
| // there are |num_desks| desks. |
| virtual void DesksStateChanged(int num_desks) const; |
| |
| // Check whether the current tab of the browser window can go back. |
| virtual bool CanGoBack(gfx::NativeWindow window) const = 0; |
| |
| // Sets the tab scrubber |enabled_| field to |enabled|. |
| virtual void SetTabScrubberEnabled(bool enabled) = 0; |
| |
| // Returns true if |window| allows default touch behaviors. If false, it means |
| // no default touch behavior is allowed (i.e., the touch action of window is |
| // cc::TouchAction::kNone). This function is used by BackGestureEventHandler |
| // to decide if we can perform the system default back gesture. |
| virtual bool AllowDefaultTouchActions(gfx::NativeWindow window); |
| |
| // Returns true if we should wait for touch press ack when deciding if back |
| // gesture can be performed. |
| virtual bool ShouldWaitForTouchPressAck(gfx::NativeWindow window); |
| |
| // Checks whether a drag-drop operation is a tab drag. |
| virtual bool IsTabDrag(const ui::OSExchangeData& drop_data); |
| |
| // Drops tab in a new browser window. |drop_data| must be from a tab |
| // drag as determined by IsTabDrag() above. |
| virtual aura::Window* CreateBrowserForTabDrop( |
| aura::Window* source_window, |
| const ui::OSExchangeData& drop_data); |
| |
| // Binds a BluetoothSystemFactory receiver if possible. |
| virtual void BindBluetoothSystemFactory( |
| mojo::PendingReceiver<device::mojom::BluetoothSystemFactory> receiver) {} |
| |
| // Binds a fingerprint receiver in the Device Service if possible. |
| virtual void BindFingerprint( |
| mojo::PendingReceiver<device::mojom::Fingerprint> receiver) {} |
| |
| // Binds a MultiDeviceSetup receiver for the primary profile. |
| virtual void BindMultiDeviceSetup( |
| mojo::PendingReceiver< |
| chromeos::multidevice_setup::mojom::MultiDeviceSetup> receiver) = 0; |
| |
| // Returns an interface to the Media Session service, or null if not |
| // available. |
| virtual media_session::MediaSessionService* GetMediaSessionService(); |
| |
| virtual void OpenKeyboardShortcutHelpPage() const {} |
| |
| // Returns if window browser sessions are restoring. |
| virtual bool IsSessionRestoreInProgress() const = 0; |
| }; |
| |
| } // namespace ash |
| |
| #endif // ASH_SHELL_DELEGATE_H_ |