Index: ash/host/window_tree_host_factory_win.cc |
diff --git a/ash/host/window_tree_host_factory_win.cc b/ash/host/window_tree_host_factory_win.cc |
index 42eb753876eb2fd8c2b71ab1b3f32142e5d4127f..1cd8670097ef636387f70b623d17d7c517869713 100644 |
--- a/ash/host/window_tree_host_factory_win.cc |
+++ b/ash/host/window_tree_host_factory_win.cc |
@@ -14,27 +14,32 @@ namespace { |
class WindowTreeHostFactoryImpl : public ash::WindowTreeHostFactory { |
public: |
- WindowTreeHostFactoryImpl() {} |
+ explicit WindowTreeHostFactoryImpl(bool test_mode) : test_mode_(test_mode) { |
+ } |
- // Overridden from WindowTreeHostFactory: |
virtual aura::WindowTreeHost* CreateWindowTreeHost( |
const gfx::Rect& initial_bounds) OVERRIDE { |
- if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
- !CommandLine::ForCurrentProcess()->HasSwitch( |
- ash::switches::kForceAshToDesktop)) |
+ if (test_mode_) |
+ return aura::WindowTreeHost::Create(initial_bounds); |
+ else |
return aura::RemoteWindowTreeHostWin::Create(initial_bounds); |
- |
- return aura::WindowTreeHost::Create(initial_bounds); |
} |
+ |
+ private: |
+ bool test_mode_; |
}; |
} |
namespace ash { |
+// static |
+WindowTreeHostFactory* WindowTreeHostFactory::CreateForTest() { |
+ return new WindowTreeHostFactoryImpl(true); |
+} |
// static |
WindowTreeHostFactory* WindowTreeHostFactory::Create() { |
- return new WindowTreeHostFactoryImpl; |
+ return new WindowTreeHostFactoryImpl(false); |
} |
} // namespace ash |