| OLD | NEW |
| 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/caps_lock_delegate_stub.h" | 9 #include "ash/caps_lock_delegate_stub.h" |
| 10 #include "ash/default_accessibility_delegate.h" | 10 #include "ash/default_accessibility_delegate.h" |
| 11 #include "ash/host/root_window_host_factory.h" | 11 #include "ash/host/root_window_host_factory.h" |
| 12 #include "ash/keyboard_controller_proxy_stub.h" | 12 #include "ash/keyboard_controller_proxy_stub.h" |
| 13 #include "ash/new_window_delegate.h" | 13 #include "ash/new_window_delegate.h" |
| 14 #include "ash/session_state_delegate.h" | 14 #include "ash/session_state_delegate.h" |
| 15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 16 #include "ash/shell_window_ids.h" | 16 #include "ash/shell_window_ids.h" |
| 17 #include "ash/test/test_launcher_delegate.h" | 17 #include "ash/test/test_launcher_delegate.h" |
| 18 #include "ash/test/test_session_state_delegate.h" | 18 #include "ash/test/test_session_state_delegate.h" |
| 19 #include "ash/test/test_system_tray_delegate.h" | 19 #include "ash/test/test_system_tray_delegate.h" |
| 20 #include "ash/test/test_user_wallpaper_delegate.h" | 20 #include "ash/test/test_user_wallpaper_delegate.h" |
| 21 #include "ash/wm/window_state.h" | 21 #include "ash/wm/window_state.h" |
| 22 #include "ash/wm/window_util.h" | 22 #include "ash/wm/window_util.h" |
| 23 #include "base/logging.h" | 23 #include "base/logging.h" |
| 24 #include "content/public/test/test_browser_context.h" | 24 #include "content/public/test/test_browser_context.h" |
| 25 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| 26 #include "ui/compositor/compositor.h" | |
| 27 | 26 |
| 28 namespace ash { | 27 namespace ash { |
| 29 namespace test { | 28 namespace test { |
| 30 namespace { | 29 namespace { |
| 31 | 30 |
| 32 class NewWindowDelegateImpl : public NewWindowDelegate { | 31 class NewWindowDelegateImpl : public NewWindowDelegate { |
| 33 virtual void NewTab() OVERRIDE {} | 32 virtual void NewTab() OVERRIDE {} |
| 34 virtual void NewWindow(bool incognito) OVERRIDE {} | 33 virtual void NewWindow(bool incognito) OVERRIDE {} |
| 35 virtual void OpenFileManager() OVERRIDE {} | 34 virtual void OpenFileManager() OVERRIDE {} |
| 36 virtual void OpenCrosh() OVERRIDE {} | 35 virtual void OpenCrosh() OVERRIDE {} |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 134 } |
| 136 | 135 |
| 137 void TestShellDelegate::HandleMediaPrevTrack() { | 136 void TestShellDelegate::HandleMediaPrevTrack() { |
| 138 } | 137 } |
| 139 | 138 |
| 140 ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) { | 139 ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) { |
| 141 return NULL; | 140 return NULL; |
| 142 } | 141 } |
| 143 | 142 |
| 144 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { | 143 RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() { |
| 145 // The ContextFactory must exist before any Compositors are created. | |
| 146 bool allow_test_contexts = true; | |
| 147 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); | |
| 148 | |
| 149 return RootWindowHostFactory::Create(); | 144 return RootWindowHostFactory::Create(); |
| 150 } | 145 } |
| 151 | 146 |
| 152 base::string16 TestShellDelegate::GetProductName() const { | 147 base::string16 TestShellDelegate::GetProductName() const { |
| 153 return base::string16(); | 148 return base::string16(); |
| 154 } | 149 } |
| 155 | 150 |
| 156 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { | 151 TestSessionStateDelegate* TestShellDelegate::test_session_state_delegate() { |
| 157 return test_session_state_delegate_; | 152 return test_session_state_delegate_; |
| 158 } | 153 } |
| 159 | 154 |
| 160 } // namespace test | 155 } // namespace test |
| 161 } // namespace ash | 156 } // namespace ash |
| OLD | NEW |