[M108 Migration] Support standard build for armv7hl architecture
[platform/framework/web/chromium-efl.git] / ash / test_shell_delegate.cc
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 #include "ash/test_shell_delegate.h"
6
7 #include <memory>
8 #include <string>
9
10 #include "ash/accessibility/default_accessibility_delegate.h"
11 #include "ash/capture_mode/test_capture_mode_delegate.h"
12 #include "ash/glanceables/test_glanceables_delegate.h"
13 #include "ash/public/cpp/test/test_desks_templates_delegate.h"
14 #include "ash/public/cpp/test/test_nearby_share_delegate.h"
15 #include "ash/system/geolocation/test_geolocation_url_loader_factory.h"
16 #include "ash/wm/gestures/back_gesture/test_back_gesture_contextual_nudge_delegate.h"
17 #include "url/gurl.h"
18
19 namespace ash {
20
21 TestShellDelegate::TestShellDelegate() = default;
22
23 TestShellDelegate::~TestShellDelegate() = default;
24
25 bool TestShellDelegate::CanShowWindowForUser(const aura::Window* window) const {
26   return true;
27 }
28
29 std::unique_ptr<CaptureModeDelegate>
30 TestShellDelegate::CreateCaptureModeDelegate() const {
31   return std::make_unique<TestCaptureModeDelegate>();
32 }
33
34 std::unique_ptr<GlanceablesDelegate>
35 TestShellDelegate::CreateGlanceablesDelegate(
36     GlanceablesController* controller) const {
37   return std::make_unique<TestGlanceablesDelegate>();
38 }
39
40 AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() {
41   return new DefaultAccessibilityDelegate;
42 }
43
44 std::unique_ptr<BackGestureContextualNudgeDelegate>
45 TestShellDelegate::CreateBackGestureContextualNudgeDelegate(
46     BackGestureContextualNudgeController* controller) {
47   return std::make_unique<TestBackGestureContextualNudgeDelegate>(controller);
48 }
49
50 std::unique_ptr<NearbyShareDelegate>
51 TestShellDelegate::CreateNearbyShareDelegate(
52     NearbyShareController* controller) const {
53   return std::make_unique<TestNearbyShareDelegate>();
54 }
55
56 std::unique_ptr<DesksTemplatesDelegate>
57 TestShellDelegate::CreateDesksTemplatesDelegate() const {
58   return std::make_unique<TestDesksTemplatesDelegate>();
59 }
60
61 scoped_refptr<network::SharedURLLoaderFactory>
62 TestShellDelegate::GetGeolocationUrlLoaderFactory() const {
63   return static_cast<scoped_refptr<network::SharedURLLoaderFactory>>(
64       base::MakeRefCounted<TestGeolocationUrlLoaderFactory>());
65 }
66
67 bool TestShellDelegate::CanGoBack(gfx::NativeWindow window) const {
68   return can_go_back_;
69 }
70
71 void TestShellDelegate::SetTabScrubberChromeOSEnabled(bool enabled) {
72   tab_scrubber_enabled_ = enabled;
73 }
74
75 void TestShellDelegate::ShouldExitFullscreenBeforeLock(
76     ShouldExitFullscreenCallback callback) {
77   std::move(callback).Run(should_exit_fullscreen_before_lock_);
78 }
79
80 bool TestShellDelegate::ShouldWaitForTouchPressAck(gfx::NativeWindow window) {
81   return should_wait_for_touch_ack_;
82 }
83
84 int TestShellDelegate::GetBrowserWebUITabStripHeight() {
85   return 0;
86 }
87
88 void TestShellDelegate::BindMultiDeviceSetup(
89     mojo::PendingReceiver<multidevice_setup::mojom::MultiDeviceSetup>
90         receiver) {
91   if (multidevice_setup_binder_)
92     multidevice_setup_binder_.Run(std::move(receiver));
93 }
94
95 void TestShellDelegate::BindMultiCaptureService(
96     mojo::PendingReceiver<video_capture::mojom::MultiCaptureService> receiver) {
97 }
98
99 void TestShellDelegate::SetCanGoBack(bool can_go_back) {
100   can_go_back_ = can_go_back;
101 }
102
103 void TestShellDelegate::SetShouldExitFullscreenBeforeLock(
104     bool should_exit_fullscreen_before_lock) {
105   should_exit_fullscreen_before_lock_ = should_exit_fullscreen_before_lock;
106 }
107
108 void TestShellDelegate::SetShouldWaitForTouchAck(
109     bool should_wait_for_touch_ack) {
110   should_wait_for_touch_ack_ = should_wait_for_touch_ack;
111 }
112
113 bool TestShellDelegate::IsSessionRestoreInProgress() const {
114   return session_restore_in_progress_;
115 }
116
117 void TestShellDelegate::SetSessionRestoreInProgress(bool in_progress) {
118   session_restore_in_progress_ = in_progress;
119 }
120
121 bool TestShellDelegate::IsLoggingRedirectDisabled() const {
122   return false;
123 }
124
125 base::FilePath TestShellDelegate::GetPrimaryUserDownloadsFolder() const {
126   return base::FilePath();
127 }
128
129 const GURL& TestShellDelegate::GetLastCommittedURLForWindowIfAny(
130     aura::Window* window) {
131   return last_committed_url_;
132 }
133
134 void TestShellDelegate::SetLastCommittedURLForWindow(const GURL& url) {
135   last_committed_url_ = url;
136 }
137
138 version_info::Channel TestShellDelegate::GetChannel() {
139   return channel_;
140 }
141
142 std::string TestShellDelegate::GetVersionString() {
143   return version_string_;
144 }
145
146 }  // namespace ash