| 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/default_capture_client.h" |
| 11 #include "ui/aura/client/stacking_client.h" | 12 #include "ui/aura/client/stacking_client.h" |
| 12 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
| 13 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 14 #include "ui/aura/shared/root_window_capture_client.h" | |
| 15 #include "ui/aura/single_display_manager.h" | 15 #include "ui/aura/single_display_manager.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
| 18 #include "ui/base/events/event.h" | 18 #include "ui/base/events/event.h" |
| 19 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/base/ui_base_paths.h" | 21 #include "ui/base/ui_base_paths.h" |
| 22 #include "ui/compositor/test/compositor_test_support.h" | 22 #include "ui/compositor/test/compositor_test_support.h" |
| 23 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 aura::client::SetStackingClient(this); | 95 aura::client::SetStackingClient(this); |
| 96 } | 96 } |
| 97 | 97 |
| 98 virtual ~DemoStackingClient() { | 98 virtual ~DemoStackingClient() { |
| 99 aura::client::SetStackingClient(NULL); | 99 aura::client::SetStackingClient(NULL); |
| 100 } | 100 } |
| 101 | 101 |
| 102 // Overridden from aura::client::StackingClient: | 102 // Overridden from aura::client::StackingClient: |
| 103 virtual aura::Window* GetDefaultParent(aura::Window* window, | 103 virtual aura::Window* GetDefaultParent(aura::Window* window, |
| 104 const gfx::Rect& bounds) OVERRIDE { | 104 const gfx::Rect& bounds) OVERRIDE { |
| 105 | |
| 106 if (!capture_client_.get()) { | 105 if (!capture_client_.get()) { |
| 107 capture_client_.reset( | 106 capture_client_.reset( |
| 108 new aura::shared::RootWindowCaptureClient(root_window_)); | 107 new aura::client::DefaultCaptureClient(root_window_)); |
| 109 } | 108 } |
| 110 return root_window_; | 109 return root_window_; |
| 111 } | 110 } |
| 112 | 111 |
| 113 private: | 112 private: |
| 114 aura::RootWindow* root_window_; | 113 aura::RootWindow* root_window_; |
| 115 | 114 |
| 116 scoped_ptr<aura::shared::RootWindowCaptureClient> capture_client_; | 115 scoped_ptr<aura::client::DefaultCaptureClient> capture_client_; |
| 117 | 116 |
| 118 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); | 117 DISALLOW_COPY_AND_ASSIGN(DemoStackingClient); |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 int DemoMain() { | 120 int DemoMain() { |
| 122 // Create the message-loop here before creating the root window. | 121 // Create the message-loop here before creating the root window. |
| 123 MessageLoop message_loop(MessageLoop::TYPE_UI); | 122 MessageLoop message_loop(MessageLoop::TYPE_UI); |
| 124 ui::CompositorTestSupport::Initialize(); | 123 ui::CompositorTestSupport::Initialize(); |
| 125 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); | 124 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); |
| 126 scoped_ptr<aura::RootWindow> root_window( | 125 scoped_ptr<aura::RootWindow> root_window( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 167 |
| 169 // The exit manager is in charge of calling the dtors of singleton objects. | 168 // The exit manager is in charge of calling the dtors of singleton objects. |
| 170 base::AtExitManager exit_manager; | 169 base::AtExitManager exit_manager; |
| 171 | 170 |
| 172 ui::RegisterPathProvider(); | 171 ui::RegisterPathProvider(); |
| 173 icu_util::Initialize(); | 172 icu_util::Initialize(); |
| 174 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 173 ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 175 | 174 |
| 176 return DemoMain(); | 175 return DemoMain(); |
| 177 } | 176 } |
| OLD | NEW |