| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/i18n/icu_util.h" | 7 #include "base/i18n/icu_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "third_party/skia/include/core/SkXfermode.h" | 10 #include "third_party/skia/include/core/SkXfermode.h" |
| 11 #include "ui/aura/client/stacking_client.h" | 11 #include "ui/aura/client/stacking_client.h" |
| 12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
| 13 #include "ui/aura/event.h" | 13 #include "ui/aura/event.h" |
| 14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 15 #include "ui/aura/single_display_manager.h" | 15 #include "ui/aura/single_display_manager.h" |
| 16 #include "ui/aura/shared/root_window_capture_client.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_delegate.h" | 18 #include "ui/aura/window_delegate.h" |
| 18 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
| 19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 20 #include "ui/base/ui_base_paths.h" | 21 #include "ui/base/ui_base_paths.h" |
| 21 #include "ui/compositor/test/compositor_test_support.h" | 22 #include "ui/compositor/test/compositor_test_support.h" |
| 22 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
| 23 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| 24 | 25 |
| 25 #if defined(USE_X11) | 26 #if defined(USE_X11) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 aura::client::SetStackingClient(this); | 90 aura::client::SetStackingClient(this); |
| 90 } | 91 } |
| 91 | 92 |
| 92 virtual ~DemoStackingClient() { | 93 virtual ~DemoStackingClient() { |
| 93 aura::client::SetStackingClient(NULL); | 94 aura::client::SetStackingClient(NULL); |
| 94 } | 95 } |
| 95 | 96 |
| 96 // Overridden from aura::client::StackingClient: | 97 // Overridden from aura::client::StackingClient: |
| 97 virtual aura::Window* GetDefaultParent(aura::Window* window, | 98 virtual aura::Window* GetDefaultParent(aura::Window* window, |
| 98 const gfx::Rect& bounds) OVERRIDE { | 99 const gfx::Rect& bounds) OVERRIDE { |
| 100 |
| 101 if (!capture_client_.get()) { |
| 102 capture_client_.reset( |
| 103 new aura::shared::RootWindowCaptureClient(root_window_)); |
| 104 } |
| 99 return root_window_; | 105 return root_window_; |
| 100 } | 106 } |
| 101 | 107 |
| 102 private: | 108 private: |
| 103 aura::RootWindow* root_window_; | 109 aura::RootWindow* root_window_; |
| 104 | 110 |
| 111 scoped_ptr<aura::shared::RootWindowCaptureClient> capture_client_; |
| 112 |
| 105 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); | 113 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); |
| 106 }; | 114 }; |
| 107 | 115 |
| 108 } // namespace | 116 } // namespace |
| 109 | 117 |
| 110 int main(int argc, char** argv) { | 118 int main(int argc, char** argv) { |
| 111 CommandLine::Init(argc, argv); | 119 CommandLine::Init(argc, argv); |
| 112 | 120 |
| 113 // The exit manager is in charge of calling the dtors of singleton objects. | 121 // The exit manager is in charge of calling the dtors of singleton objects. |
| 114 base::AtExitManager exit_manager; | 122 base::AtExitManager exit_manager; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 window3.Show(); | 159 window3.Show(); |
| 152 window3.SetParent(&window2); | 160 window3.SetParent(&window2); |
| 153 | 161 |
| 154 root_window->ShowRootWindow(); | 162 root_window->ShowRootWindow(); |
| 155 MessageLoopForUI::current()->Run(); | 163 MessageLoopForUI::current()->Run(); |
| 156 | 164 |
| 157 ui::CompositorTestSupport::Terminate(); | 165 ui::CompositorTestSupport::Terminate(); |
| 158 | 166 |
| 159 return 0; | 167 return 0; |
| 160 } | 168 } |
| OLD | NEW |