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

Unified Diff: ash/host/window_tree_host_factory_win.cc

Issue 227573007: Third part of porting Chrome Ash to Windows 7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lf Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698