[M108 Migration][Callback] Bring up ewk callbacks which are related with page loading
[platform/framework/web/chromium-efl.git] / ash / test_shell_delegate.h
1 // Copyright 2012 The Chromium Authors
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_TEST_SHELL_DELEGATE_H_
6 #define ASH_TEST_SHELL_DELEGATE_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
12 #include "ash/shell_delegate.h"
13 #include "base/callback.h"
14 #include "mojo/public/cpp/bindings/pending_receiver.h"
15 #include "url/gurl.h"
16
17 namespace ash {
18
19 class TestShellDelegate : public ShellDelegate {
20  public:
21   TestShellDelegate();
22
23   TestShellDelegate(const TestShellDelegate&) = delete;
24   TestShellDelegate& operator=(const TestShellDelegate&) = delete;
25
26   ~TestShellDelegate() override;
27
28   // Allows tests to override the MultiDeviceSetup binding behavior for this
29   // TestShellDelegate.
30   using MultiDeviceSetupBinder = base::RepeatingCallback<void(
31       mojo::PendingReceiver<multidevice_setup::mojom::MultiDeviceSetup>)>;
32   void SetMultiDeviceSetupBinder(MultiDeviceSetupBinder binder) {
33     multidevice_setup_binder_ = std::move(binder);
34   }
35
36   // Overridden from ShellDelegate:
37   bool CanShowWindowForUser(const aura::Window* window) const override;
38   std::unique_ptr<CaptureModeDelegate> CreateCaptureModeDelegate()
39       const override;
40   std::unique_ptr<GlanceablesDelegate> CreateGlanceablesDelegate(
41       GlanceablesController* controller) const override;
42   AccessibilityDelegate* CreateAccessibilityDelegate() override;
43   std::unique_ptr<BackGestureContextualNudgeDelegate>
44   CreateBackGestureContextualNudgeDelegate(
45       BackGestureContextualNudgeController* controller) override;
46   std::unique_ptr<NearbyShareDelegate> CreateNearbyShareDelegate(
47       NearbyShareController* controller) const override;
48   std::unique_ptr<DesksTemplatesDelegate> CreateDesksTemplatesDelegate()
49       const override;
50   scoped_refptr<network::SharedURLLoaderFactory>
51   GetGeolocationUrlLoaderFactory() const override;
52   bool CanGoBack(gfx::NativeWindow window) const override;
53   void SetTabScrubberChromeOSEnabled(bool enabled) override;
54   void ShouldExitFullscreenBeforeLock(
55       ShouldExitFullscreenCallback callback) override;
56   bool ShouldWaitForTouchPressAck(gfx::NativeWindow window) override;
57   int GetBrowserWebUITabStripHeight() override;
58   void BindMultiDeviceSetup(
59       mojo::PendingReceiver<multidevice_setup::mojom::MultiDeviceSetup>
60           receiver) override;
61   void BindMultiCaptureService(
62       mojo::PendingReceiver<video_capture::mojom::MultiCaptureService> receiver)
63       override;
64   bool IsSessionRestoreInProgress() const override;
65   void SetUpEnvironmentForLockedFullscreen(bool locked) override {}
66   const GURL& GetLastCommittedURLForWindowIfAny(aura::Window* window) override;
67   void ForceSkipWarningUserOnClose(
68       const std::vector<aura::Window*>& windows) override {}
69
70   void SetCanGoBack(bool can_go_back);
71   void SetShouldExitFullscreenBeforeLock(
72       bool should_exit_fullscreen_before_lock);
73   void SetShouldWaitForTouchAck(bool should_wait_for_touch_ack);
74   void SetSessionRestoreInProgress(bool in_progress);
75   bool IsLoggingRedirectDisabled() const override;
76   base::FilePath GetPrimaryUserDownloadsFolder() const override;
77   void OpenFeedbackPageForPersistentDesksBar() override {}
78   void SetLastCommittedURLForWindow(const GURL& url);
79   version_info::Channel GetChannel() override;
80   std::string GetVersionString() override;
81
82   void set_channel(version_info::Channel channel) { channel_ = channel; }
83
84   void set_version_string(const std::string& string) {
85     version_string_ = string;
86   }
87
88  private:
89   // True if the current top window can go back.
90   bool can_go_back_ = true;
91
92   // True if the tab scrubber is enabled.
93   bool tab_scrubber_enabled_ = true;
94
95   // False if it is allowed by policy to keep fullscreen after unlock.
96   bool should_exit_fullscreen_before_lock_ = true;
97
98   // True if when performing back gesture on the top window, we should handle
99   // the event after the touch ack is received. Please refer to
100   // |BackGestureEventHandler::should_wait_for_touch_ack_| for detailed
101   // description.
102   bool should_wait_for_touch_ack_ = false;
103
104   // True if window browser sessions are restoring.
105   bool session_restore_in_progress_ = false;
106
107   MultiDeviceSetupBinder multidevice_setup_binder_;
108
109   GURL last_committed_url_ = GURL::EmptyGURL();
110
111   version_info::Channel channel_ = version_info::Channel::UNKNOWN;
112
113   std::string version_string_;
114 };
115
116 }  // namespace ash
117
118 #endif  // ASH_TEST_SHELL_DELEGATE_H_