Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: ash/test/test_shell_delegate.cc

Issue 2434463004: mash: Move directly linked NewWindowDelegate to mojom::NewWindowClient. (Closed)
Patch Set: Rebase to ToT Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/test/test_shell_delegate.h" 5 #include "ash/test/test_shell_delegate.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "ash/app_list/app_list_presenter_delegate.h" 9 #include "ash/app_list/app_list_presenter_delegate.h"
10 #include "ash/app_list/app_list_presenter_delegate_factory.h" 10 #include "ash/app_list/app_list_presenter_delegate_factory.h"
11 #include "ash/common/default_accessibility_delegate.h" 11 #include "ash/common/default_accessibility_delegate.h"
12 #include "ash/common/gpu_support_stub.h" 12 #include "ash/common/gpu_support_stub.h"
13 #include "ash/common/media_delegate.h" 13 #include "ash/common/media_delegate.h"
14 #include "ash/common/new_window_delegate.h"
15 #include "ash/common/palette_delegate.h" 14 #include "ash/common/palette_delegate.h"
16 #include "ash/common/session/session_state_delegate.h" 15 #include "ash/common/session/session_state_delegate.h"
17 #include "ash/common/test/test_session_state_delegate.h" 16 #include "ash/common/test/test_session_state_delegate.h"
18 #include "ash/common/test/test_shelf_delegate.h" 17 #include "ash/common/test/test_shelf_delegate.h"
19 #include "ash/common/test/test_system_tray_delegate.h" 18 #include "ash/common/test/test_system_tray_delegate.h"
20 #include "ash/common/wm/window_state.h" 19 #include "ash/common/wm/window_state.h"
21 #include "ash/common/wm_shell.h" 20 #include "ash/common/wm_shell.h"
22 #include "ash/public/cpp/shell_window_ids.h" 21 #include "ash/public/cpp/shell_window_ids.h"
23 #include "ash/test/test_keyboard_ui.h" 22 #include "ash/test/test_keyboard_ui.h"
24 #include "ash/test/test_wallpaper_delegate.h" 23 #include "ash/test/test_wallpaper_delegate.h"
25 #include "ash/wm/window_util.h" 24 #include "ash/wm/window_util.h"
26 #include "base/logging.h" 25 #include "base/logging.h"
27 #include "base/memory/ptr_util.h" 26 #include "base/memory/ptr_util.h"
28 #include "ui/app_list/presenter/app_list_presenter_impl.h" 27 #include "ui/app_list/presenter/app_list_presenter_impl.h"
29 #include "ui/app_list/presenter/app_list_view_delegate_factory.h" 28 #include "ui/app_list/presenter/app_list_view_delegate_factory.h"
30 #include "ui/app_list/test/app_list_test_view_delegate.h" 29 #include "ui/app_list/test/app_list_test_view_delegate.h"
31 #include "ui/aura/window.h" 30 #include "ui/aura/window.h"
32 #include "ui/gfx/image/image.h" 31 #include "ui/gfx/image/image.h"
33 32
34 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
35 #include "ash/common/system/tray/system_tray_notifier.h" 34 #include "ash/common/system/tray/system_tray_notifier.h"
36 #endif 35 #endif
37 36
38 namespace ash { 37 namespace ash {
39 namespace test { 38 namespace test {
40 namespace { 39 namespace {
41 40
42 class NewWindowDelegateImpl : public NewWindowDelegate {
43 public:
44 NewWindowDelegateImpl() {}
45 ~NewWindowDelegateImpl() override {}
46
47 private:
48 // NewWindowDelegate:
49 void NewTab() override {}
50 void NewWindow(bool incognito) override {}
51 void OpenFileManager() override {}
52 void OpenCrosh() override {}
53 void OpenGetHelp() override {}
54 void RestoreTab() override {}
55 void ShowKeyboardOverlay() override {}
56 void ShowTaskManager() override {}
57 void OpenFeedbackPage() override {}
58
59 DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl);
60 };
61
62 class MediaDelegateImpl : public MediaDelegate { 41 class MediaDelegateImpl : public MediaDelegate {
63 public: 42 public:
64 MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {} 43 MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {}
65 ~MediaDelegateImpl() override {} 44 ~MediaDelegateImpl() override {}
66 45
67 void set_media_capture_state(MediaCaptureState state) { state_ = state; } 46 void set_media_capture_state(MediaCaptureState state) { state_ = state; }
68 47
69 private: 48 private:
70 // MediaDelegate: 49 // MediaDelegate:
71 void HandleMediaNextTrack() override {} 50 void HandleMediaNextTrack() override {}
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 } 151 }
173 152
174 TestSessionStateDelegate* TestShellDelegate::CreateSessionStateDelegate() { 153 TestSessionStateDelegate* TestShellDelegate::CreateSessionStateDelegate() {
175 return new TestSessionStateDelegate(); 154 return new TestSessionStateDelegate();
176 } 155 }
177 156
178 AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() { 157 AccessibilityDelegate* TestShellDelegate::CreateAccessibilityDelegate() {
179 return new DefaultAccessibilityDelegate(); 158 return new DefaultAccessibilityDelegate();
180 } 159 }
181 160
182 NewWindowDelegate* TestShellDelegate::CreateNewWindowDelegate() {
183 return new NewWindowDelegateImpl;
184 }
185
186 MediaDelegate* TestShellDelegate::CreateMediaDelegate() { 161 MediaDelegate* TestShellDelegate::CreateMediaDelegate() {
187 return new MediaDelegateImpl; 162 return new MediaDelegateImpl;
188 } 163 }
189 164
190 std::unique_ptr<PaletteDelegate> TestShellDelegate::CreatePaletteDelegate() { 165 std::unique_ptr<PaletteDelegate> TestShellDelegate::CreatePaletteDelegate() {
191 return nullptr; 166 return nullptr;
192 } 167 }
193 168
194 ui::MenuModel* TestShellDelegate::CreateContextMenu(WmShelf* wm_shelf, 169 ui::MenuModel* TestShellDelegate::CreateContextMenu(WmShelf* wm_shelf,
195 const ShelfItem* item) { 170 const ShelfItem* item) {
(...skipping 16 matching lines...) Expand all
212 void TestShellDelegate::SetMediaCaptureState(MediaCaptureState state) { 187 void TestShellDelegate::SetMediaCaptureState(MediaCaptureState state) {
213 #if defined(OS_CHROMEOS) 188 #if defined(OS_CHROMEOS)
214 static_cast<MediaDelegateImpl*>(WmShell::Get()->media_delegate()) 189 static_cast<MediaDelegateImpl*>(WmShell::Get()->media_delegate())
215 ->set_media_capture_state(state); 190 ->set_media_capture_state(state);
216 WmShell::Get()->system_tray_notifier()->NotifyMediaCaptureChanged(); 191 WmShell::Get()->system_tray_notifier()->NotifyMediaCaptureChanged();
217 #endif 192 #endif
218 } 193 }
219 194
220 } // namespace test 195 } // namespace test
221 } // namespace ash 196 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_shell_delegate.h ('k') | chrome/app/mash/chrome_mash_content_browser_manifest_overlay.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698