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

Unified Diff: ui/aura/root_window.cc

Issue 11360045: ash: Add RootWindowHostFactory class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 6e111561f4fe116ef29eef89a26690c53209248f..268aecf70b208ea668ff7bf01fb8ea8604171f2a 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -20,6 +20,7 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
+#include "ui/aura/root_window_delegate.h"
#include "ui/aura/root_window_host.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window.h"
@@ -75,8 +76,9 @@ void SetLastMouseLocation(const Window* root_window,
RootWindowHost* CreateHost(RootWindow* root_window,
const RootWindow::CreateParams& params) {
- RootWindowHost* host = params.host ?
- params.host : RootWindowHost::Create(params.initial_bounds);
+ RootWindowHost* host = params.delegate ?
+ params.delegate->CreateRootWindowHost(params.initial_bounds) :
+ RootWindowHost::Create(params.initial_bounds);
host->SetDelegate(root_window);
return host;
}
@@ -85,7 +87,7 @@ RootWindowHost* CreateHost(RootWindow* root_window,
RootWindow::CreateParams::CreateParams(const gfx::Rect& a_initial_bounds)
: initial_bounds(a_initial_bounds),
- host(NULL) {
+ delegate(NULL) {
}
////////////////////////////////////////////////////////////////////////////////
@@ -113,6 +115,7 @@ RootWindow::RootWindow(const CreateParams& params)
ALLOW_THIS_IN_INITIALIZER_LIST(held_mouse_event_factory_(this)) {
SetName("RootWindow");
+ delegate_.reset(params.delegate);
compositor_.reset(new ui::Compositor(this, host_->GetAcceleratedWidget()));
DCHECK(compositor_.get());
compositor_->AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698