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

Side by Side Diff: ui/aura/test/test_stacking_client.cc

Issue 8894018: Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/test/test_stacking_client.h ('k') | ui/aura/test/test_window_delegate.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura/test/test_stacking_client.h" 5 #include "ui/aura/test/test_stacking_client.h"
6 6
7 #include "ui/aura/root_window.h" 7 #include "ui/aura/root_window.h"
8 8
9 namespace aura { 9 namespace aura {
10 namespace test { 10 namespace test {
11 11
12 TestStackingClient::TestStackingClient() 12 TestStackingClient::TestStackingClient()
13 : default_container_(new Window(NULL)) { 13 : default_container_(new Window(NULL)) {
14 RootWindow::GetInstance()->SetStackingClient(this); 14 RootWindow::GetInstance()->SetStackingClient(this);
15 default_container_->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); 15 default_container_->Init(ui::Layer::LAYER_HAS_NO_TEXTURE);
16 default_container_->SetBounds( 16 default_container_->SetBounds(
17 gfx::Rect(gfx::Point(), RootWindow::GetInstance()->GetHostSize())); 17 gfx::Rect(gfx::Point(), RootWindow::GetInstance()->GetHostSize()));
18 RootWindow::GetInstance()->AddChild(default_container_.get()); 18 RootWindow::GetInstance()->AddChild(default_container_.get());
19 default_container_->Show(); 19 default_container_->Show();
20 } 20 }
21 21
22 TestStackingClient::~TestStackingClient() { 22 TestStackingClient::~TestStackingClient() {
23 } 23 }
24 24
25 void TestStackingClient::AddChildToDefaultParent(Window* window) { 25 void TestStackingClient::AddChildToDefaultParent(Window* window) {
26 default_container_->AddChild(window); 26 default_container_->AddChild(window);
27 } 27 }
28 28
29 bool TestStackingClient::CanActivateWindow(Window* window) const {
30 return window->parent() == default_container_;
31 }
32
33 Window* TestStackingClient::GetTopmostWindowToActivate(Window* ignore) const {
34 for (aura::Window::Windows::const_reverse_iterator i =
35 default_container_->children().rbegin();
36 i != default_container_->children().rend();
37 ++i) {
38 if (*i != ignore && (*i)->CanActivate())
39 return *i;
40 }
41 return NULL;
42 }
43
44 } // namespace test 29 } // namespace test
45 } // namespace aura 30 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_stacking_client.h ('k') | ui/aura/test/test_window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698