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

Unified Diff: ui/aura/remote_root_window_host_win.cc

Issue 22876030: Remove using the Shell desktop Window when we don't have an acceleated widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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: ui/aura/remote_root_window_host_win.cc
===================================================================
--- ui/aura/remote_root_window_host_win.cc (revision 217576)
+++ ui/aura/remote_root_window_host_win.cc (working copy)
@@ -108,33 +108,39 @@
RemoteRootWindowHostWin* g_instance = NULL;
RemoteRootWindowHostWin* RemoteRootWindowHostWin::Instance() {
- return g_instance;
+ if (g_instance)
+ return g_instance;
+ return Create(gfx::Rect());
}
RemoteRootWindowHostWin* RemoteRootWindowHostWin::Create(
const gfx::Rect& bounds) {
- g_instance = new RemoteRootWindowHostWin(bounds);
+ g_instance = g_instance ? g_instance : new RemoteRootWindowHostWin(bounds);
return g_instance;
}
RemoteRootWindowHostWin::RemoteRootWindowHostWin(const gfx::Rect& bounds)
- : delegate_(NULL),
+ : remote_window_(NULL),
+ delegate_(NULL),
host_(NULL),
ignore_mouse_moves_until_set_cursor_ack_(false) {
prop_.reset(new ui::ViewProp(NULL, kRootWindowHostWinKey, this));
}
RemoteRootWindowHostWin::~RemoteRootWindowHostWin() {
+ g_instance = NULL;
}
-void RemoteRootWindowHostWin::Connected(IPC::Sender* host) {
+void RemoteRootWindowHostWin::Connected(IPC::Sender* host, HWND remote_window) {
CHECK(host_ == NULL);
host_ = host;
+ remote_window_ = remote_window;
}
void RemoteRootWindowHostWin::Disconnected() {
CHECK(host_ != NULL);
host_ = NULL;
+ remote_window_ = NULL;
}
bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) {
@@ -271,10 +277,9 @@
}
gfx::AcceleratedWidget RemoteRootWindowHostWin::GetAcceleratedWidget() {
- // TODO(cpu): This is bad. Chrome's compositor needs a valid window
- // initially and then later on we swap it. Since the compositor never
- // uses this initial window we tell ourselves this hack is ok to get
- // thing off the ground.
+ if (remote_window_)
+ return remote_window_;
+ // Getting here should only happen for ash_unittests.exe and related code.
return ::GetDesktopWindow();
}

Powered by Google App Engine
This is Rietveld 408576698