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

Side by Side Diff: ui/aura/demo/demo_main.cc

Issue 10808071: Set CaptureClient instance for aura_demo and aura_bench (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update their DEPS files Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/aura/demo/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « ui/aura/demo/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698