blob: df02db1848f1543944ab78523f344bc2ce4a2bd2 [file] [log] [blame]
James Cookb0bf8e82017-04-09 17:01:441// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef ASH_SHELL_DELEGATE_H_
6#define ASH_SHELL_DELEGATE_H_
7
8#include <memory>
Xiaoqian Daie26ad8502021-06-17 00:33:459#include <vector>
James Cookb0bf8e82017-04-09 17:01:4410
11#include "ash/ash_export.h"
Alexander Alekseev2b4c9592021-05-04 22:26:4412#include "base/files/file_path.h"
Ken Rockot6b5017e2019-12-05 20:39:4113#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom-forward.h"
Stefan Kuhne39a41102021-09-28 18:50:1714#include "chromeos/ui/base/window_pin_type.h"
Ken Rockot3f90e70e02019-12-04 23:27:2315#include "mojo/public/cpp/bindings/pending_receiver.h"
Ken Rockotb9bab542019-12-12 00:53:3016#include "services/device/public/mojom/bluetooth_system.mojom-forward.h"
17#include "services/device/public/mojom/fingerprint.mojom-forward.h"
Becca Hughesc7427842020-11-04 23:27:3818#include "services/media_session/public/cpp/media_session_service.h"
minch64f3b43b2019-10-21 21:59:2619#include "ui/gfx/native_widget_types.h"
James Cookb0bf8e82017-04-09 17:01:4420
varkhad43f55242017-05-26 20:55:5821namespace aura {
22class Window;
23}
24
Collin Baker1ca0b7a32020-04-14 18:33:0025namespace ui {
26class OSExchangeData;
27}
28
James Cookb0bf8e82017-04-09 17:01:4429namespace ash {
30
31class AccessibilityDelegate;
Xiaoqian Daic9f06c792020-02-19 20:52:3532class BackGestureContextualNudgeController;
Richard Chui7f2b9b02021-10-27 01:25:4433class BackGestureContextualNudgeDelegate;
34class CaptureModeDelegate;
Sammie Quon143922902021-11-12 00:02:0135class DesksTemplatesDelegate;
Curt Clemens1def3a32020-09-21 20:10:2436class NearbyShareController;
Curt Clemensc6659632020-09-16 18:32:1537class NearbyShareDelegate;
James Cookb0bf8e82017-04-09 17:01:4438
39// Delegate of the Shell.
40class ASH_EXPORT ShellDelegate {
41 public:
42 // The Shell owns the delegate.
Ahmed Fakhry0c6efef2020-07-30 21:51:1943 virtual ~ShellDelegate() = default;
James Cookb0bf8e82017-04-09 17:01:4444
James Cookb0bf8e82017-04-09 17:01:4445 // Returns true if |window| can be shown for the delegate's concept of current
46 // user.
Andrew Xu048f24b2019-01-16 21:21:2347 virtual bool CanShowWindowForUser(const aura::Window* window) const = 0;
James Cookb0bf8e82017-04-09 17:01:4448
Ahmed Fakhry0c6efef2020-07-30 21:51:1949 // Creates and returns the delegate of the Capture Mode feature.
50 virtual std::unique_ptr<CaptureModeDelegate> CreateCaptureModeDelegate()
51 const = 0;
52
James Cookb0bf8e82017-04-09 17:01:4453 // Creates a accessibility delegate. Shell takes ownership of the delegate.
54 virtual AccessibilityDelegate* CreateAccessibilityDelegate() = 0;
55
Xiaoqian Daic9f06c792020-02-19 20:52:3556 // Creates a back gesture contextual nudge delegate for |controller|.
57 virtual std::unique_ptr<BackGestureContextualNudgeDelegate>
58 CreateBackGestureContextualNudgeDelegate(
59 BackGestureContextualNudgeController* controller) = 0;
60
Curt Clemens1def3a32020-09-21 20:10:2461 virtual std::unique_ptr<NearbyShareDelegate> CreateNearbyShareDelegate(
62 NearbyShareController* controller) const = 0;
Curt Clemensc6659632020-09-16 18:32:1563
Sammie Quon143922902021-11-12 00:02:0164 virtual std::unique_ptr<DesksTemplatesDelegate> CreateDesksTemplatesDelegate()
65 const = 0;
66
minch64f3b43b2019-10-21 21:59:2667 // Check whether the current tab of the browser window can go back.
68 virtual bool CanGoBack(gfx::NativeWindow window) const = 0;
69
chinsenjade910fd2020-09-30 20:28:1670 // Sets the tab scrubber |enabled_| field to |enabled|.
Antonio Gomesdeb475f52021-12-07 16:21:0071 virtual void SetTabScrubberChromeOSEnabled(bool enabled) = 0;
chinsenjade910fd2020-09-30 20:28:1672
Xiaoqian Dai1067eab2020-06-03 22:20:3373 // Returns true if |window| allows default touch behaviors. If false, it means
74 // no default touch behavior is allowed (i.e., the touch action of window is
75 // cc::TouchAction::kNone). This function is used by BackGestureEventHandler
76 // to decide if we can perform the system default back gesture.
77 virtual bool AllowDefaultTouchActions(gfx::NativeWindow window);
78
79 // Returns true if we should wait for touch press ack when deciding if back
80 // gesture can be performed.
81 virtual bool ShouldWaitForTouchPressAck(gfx::NativeWindow window);
82
Collin Bakere5fb2f692020-05-14 01:24:4483 // Checks whether a drag-drop operation is a tab drag.
84 virtual bool IsTabDrag(const ui::OSExchangeData& drop_data);
85
Yuheng Huange141ef22021-07-07 18:03:5186 // Return the height of WebUI tab strip used to determine if a tab has
87 // dragged out of it.
88 virtual int GetBrowserWebUITabStripHeight() = 0;
89
Ken Rockotb9bab542019-12-12 00:53:3090 // Binds a BluetoothSystemFactory receiver if possible.
91 virtual void BindBluetoothSystemFactory(
92 mojo::PendingReceiver<device::mojom::BluetoothSystemFactory> receiver) {}
93
94 // Binds a fingerprint receiver in the Device Service if possible.
95 virtual void BindFingerprint(
96 mojo::PendingReceiver<device::mojom::Fingerprint> receiver) {}
97
Ken Rockot6b5017e2019-12-05 20:39:4198 // Binds a MultiDeviceSetup receiver for the primary profile.
99 virtual void BindMultiDeviceSetup(
100 mojo::PendingReceiver<
101 chromeos::multidevice_setup::mojom::MultiDeviceSetup> receiver) = 0;
102
Ken Rockotb2ac2f12019-12-06 18:33:54103 // Returns an interface to the Media Session service, or null if not
104 // available.
Becca Hughesc7427842020-11-04 23:27:38105 virtual media_session::MediaSessionService* GetMediaSessionService();
Ken Rockotb2ac2f12019-12-06 18:33:54106
James Cookb0bf8e82017-04-09 17:01:44107 virtual void OpenKeyboardShortcutHelpPage() const {}
Cattalyya Nuengsigkapian8c45e302021-01-06 21:48:08108
109 // Returns if window browser sessions are restoring.
110 virtual bool IsSessionRestoreInProgress() const = 0;
Alexander Alekseev494b2d32021-01-20 06:16:43111
Sean Kau8542a122021-10-15 22:46:06112 // Adjust system configuration for a Locked Fullscreen window.
113 virtual void SetUpEnvironmentForLockedFullscreen(bool locked) = 0;
Stefan Kuhne39a41102021-09-28 18:50:17114
Alexander Alekseev494b2d32021-01-20 06:16:43115 // Ui Dev Tools control.
116 virtual bool IsUiDevToolsStarted() const;
117 virtual void StartUiDevTools() {}
118 virtual void StopUiDevTools() {}
119 virtual int GetUiDevToolsPort() const;
Alexander Alekseev2b4c9592021-05-04 22:26:44120
121 // Returns true if Chrome was started with --disable-logging-redirect option.
122 virtual bool IsLoggingRedirectDisabled() const = 0;
123
Xiaoqian Daie26ad8502021-06-17 00:33:45124 // Returns empty path if user session has not started yet, or path to the
Alexander Alekseev2b4c9592021-05-04 22:26:44125 // primary user Downloads folder if user has already logged in.
126 virtual base::FilePath GetPrimaryUserDownloadsFolder() const = 0;
Xiaoqian Daie26ad8502021-06-17 00:33:45127
minch3453ad12021-06-21 18:25:11128 // Opens the feedback page with pre-populated description #BentoBar for
129 // persistent desks bar. Note, this will be removed once the feature is fully
130 // launched or removed.
131 virtual void OpenFeedbackPageForPersistentDesksBar() = 0;
James Cookb0bf8e82017-04-09 17:01:44132};
133
134} // namespace ash
135
136#endif // ASH_SHELL_DELEGATE_H_