[email protected] | 40c4cbb | 2012-01-10 23:26:07 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | f7eb89c | 2011-12-13 09:48:54 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
James Cook | 346c8c6 | 2017-07-18 19:38:37 | [diff] [blame] | 5 | #include "ash/test_shell_delegate.h" |
[email protected] | f7eb89c | 2011-12-13 09:48:54 | [diff] [blame] | 6 | |
Qiang Xu | 89af823e | 2017-12-05 04:04:47 | [diff] [blame] | 7 | #include "ash/accessibility/default_accessibility_delegate.h" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 8 | #include "ash/system/tray/system_tray_notifier.h" |
James Cook | 5e9d340 | 2017-11-01 00:20:12 | [diff] [blame] | 9 | #include "ash/test_screenshot_delegate.h" |
Xiaoqian Dai | c9f06c79 | 2020-02-19 20:52:35 | [diff] [blame] | 10 | #include "ash/wm/gestures/back_gesture/test_back_gesture_contextual_nudge_delegate.h" |
[email protected] | fcb123d | 2013-04-17 15:58:49 | [diff] [blame] | 11 | #include "base/logging.h" |
afakhry | cd2bb98d | 2015-09-09 09:03:42 | [diff] [blame] | 12 | #include "ui/gfx/image/image.h" |
[email protected] | 40c4cbb | 2012-01-10 23:26:07 | [diff] [blame] | 13 | |
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 14 | namespace ash { |
[email protected] | f7eb89c | 2011-12-13 09:48:54 | [diff] [blame] | 15 | |
warx | 67a6d3f | 2017-05-31 21:00:21 | [diff] [blame] | 16 | TestShellDelegate::TestShellDelegate() = default; |
[email protected] | f7eb89c | 2011-12-13 09:48:54 | [diff] [blame] | 17 | |
warx | 67a6d3f | 2017-05-31 21:00:21 | [diff] [blame] | 18 | TestShellDelegate::~TestShellDelegate() = default; |
[email protected] | f7eb89c | 2011-12-13 09:48:54 | [diff] [blame] | 19 | |
Andrew Xu | 048f24b | 2019-01-16 21:21:23 | [diff] [blame] | 20 | bool TestShellDelegate::CanShowWindowForUser(const aura::Window* window) const { |
ben | 894584d | 2015-09-30 23:56:53 | [diff] [blame] | 21 | return true; |
22 | } | ||||
23 | |||||
James Cook | 5e9d340 | 2017-11-01 00:20:12 | [diff] [blame] | 24 | std::unique_ptr<ScreenshotDelegate> |
25 | TestShellDelegate::CreateScreenshotDelegate() { | ||||
26 | return std::make_unique<TestScreenshotDelegate>(); | ||||
27 | } | ||||
28 | |||||
[email protected] | f3ab6eff5 | 2013-10-24 03:29:38 | [diff] [blame] | 29 | AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() { |
Qiang Xu | 89af823e | 2017-12-05 04:04:47 | [diff] [blame] | 30 | return new DefaultAccessibilityDelegate; |
[email protected] | f3ab6eff5 | 2013-10-24 03:29:38 | [diff] [blame] | 31 | } |
32 | |||||
Xiaoqian Dai | c9f06c79 | 2020-02-19 20:52:35 | [diff] [blame] | 33 | std::unique_ptr<BackGestureContextualNudgeDelegate> |
34 | TestShellDelegate::CreateBackGestureContextualNudgeDelegate( | ||||
35 | BackGestureContextualNudgeController* controller) { | ||||
36 | return std::make_unique<TestBackGestureContextualNudgeDelegate>(controller); | ||||
37 | } | ||||
38 | |||||
minch | 64f3b43b | 2019-10-21 21:59:26 | [diff] [blame] | 39 | bool TestShellDelegate::CanGoBack(gfx::NativeWindow window) const { |
minch | 4553eb0 | 2019-11-20 23:25:47 | [diff] [blame] | 40 | return can_go_back_; |
41 | } | ||||
42 | |||||
Ken Rockot | 3f90e70e0 | 2019-12-04 23:27:23 | [diff] [blame] | 43 | void TestShellDelegate::BindNavigableContentsFactory( |
44 | mojo::PendingReceiver<content::mojom::NavigableContentsFactory> receiver) {} | ||||
45 | |||||
Ken Rockot | 6b5017e | 2019-12-05 20:39:41 | [diff] [blame] | 46 | void TestShellDelegate::BindMultiDeviceSetup( |
47 | mojo::PendingReceiver<chromeos::multidevice_setup::mojom::MultiDeviceSetup> | ||||
48 | receiver) { | ||||
49 | if (multidevice_setup_binder_) | ||||
50 | multidevice_setup_binder_.Run(std::move(receiver)); | ||||
51 | } | ||||
52 | |||||
minch | 4553eb0 | 2019-11-20 23:25:47 | [diff] [blame] | 53 | void TestShellDelegate::SetCanGoBack(bool can_go_back) { |
54 | can_go_back_ = can_go_back; | ||||
minch | 64f3b43b | 2019-10-21 21:59:26 | [diff] [blame] | 55 | } |
56 | |||||
[email protected] | 55f59335 | 2011-12-24 05:42:46 | [diff] [blame] | 57 | } // namespace ash |