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

Unified Diff: ui/aura/demo/demo_main.cc

Issue 9688003: aura: Fix segfault when launching aura_demo on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DemoStackingClient Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/demo/demo_main.cc
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index be1c68471f7a8877980d84ad926ef604f207bd9e..fff12813fcc3b18ef20a6d0b8a04f1583fac0bbd 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "third_party/skia/include/core/SkXfermode.h"
+#include "ui/aura/client/stacking_client.h"
#include "ui/aura/event.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -71,6 +72,27 @@ class DemoWindowDelegate : public aura::WindowDelegate {
DISALLOW_COPY_AND_ASSIGN(DemoWindowDelegate);
};
+class DemoStackingClient : public aura::client::StackingClient {
+ public:
+ explicit DemoStackingClient(aura::RootWindow* root_window)
+ : root_window_(root_window) {
+ aura::client::SetStackingClient(this);
+ }
+
+ virtual ~DemoStackingClient() {
+ aura::client::SetStackingClient(NULL);
+ }
+
+ // Overridden from aura::client::StackingClient:
+ virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE {
+ return root_window_;
+ }
+
+ private:
+ aura::RootWindow* root_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(DemoStackingClient);
+};
} // namespace
@@ -89,6 +111,8 @@ int main(int argc, char** argv) {
ui::CompositorTestSupport::Initialize();
scoped_ptr<aura::RootWindow> root_window(new aura::RootWindow);
+ scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient(
+ root_window.get()));
// Create a hierarchy of test windows.
DemoWindowDelegate window_delegate1(SK_ColorBLUE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698