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

Side by Side Diff: ui/aura_shell/always_on_top_controller.cc

Issue 8968022: Shell related switches -> aura shell switches. (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_shell/activation_controller_unittest.cc ('k') | ui/aura_shell/aura_shell.gyp » ('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_shell/always_on_top_controller.h" 5 #include "ui/aura_shell/always_on_top_controller.h"
6 6
7 #include "ui/aura/client/aura_constants.h" 7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_types.h"
10 9
11 namespace aura_shell { 10 namespace aura_shell {
12 namespace internal { 11 namespace internal {
13 12
14 AlwaysOnTopController::AlwaysOnTopController() 13 AlwaysOnTopController::AlwaysOnTopController()
15 : default_container_(NULL), 14 : default_container_(NULL),
16 always_on_top_container_(NULL) { 15 always_on_top_container_(NULL) {
17 } 16 }
18 17
19 AlwaysOnTopController::~AlwaysOnTopController() { 18 AlwaysOnTopController::~AlwaysOnTopController() {
(...skipping 14 matching lines...) Expand all
34 33
35 default_container_ = default_container; 34 default_container_ = default_container;
36 default_container_->AddObserver(this); 35 default_container_->AddObserver(this);
37 36
38 always_on_top_container_ = always_on_top_container; 37 always_on_top_container_ = always_on_top_container;
39 always_on_top_container_->AddObserver(this); 38 always_on_top_container_->AddObserver(this);
40 } 39 }
41 40
42 aura::Window* AlwaysOnTopController::GetContainer(aura::Window* window) const { 41 aura::Window* AlwaysOnTopController::GetContainer(aura::Window* window) const {
43 DCHECK(default_container_ && always_on_top_container_); 42 DCHECK(default_container_ && always_on_top_container_);
44 return !window->GetProperty(aura::kAlwaysOnTopKey) ? default_container_ : 43 return !window->GetProperty(aura::client::kAlwaysOnTopKey) ?
45 always_on_top_container_; 44 default_container_ : always_on_top_container_;
46 } 45 }
47 46
48 void AlwaysOnTopController::OnWindowAdded(aura::Window* child) { 47 void AlwaysOnTopController::OnWindowAdded(aura::Window* child) {
49 // Observe direct child of the containers. 48 // Observe direct child of the containers.
50 if (child->parent() == default_container_ || 49 if (child->parent() == default_container_ ||
51 child->parent() == always_on_top_container_) { 50 child->parent() == always_on_top_container_) {
52 child->AddObserver(this); 51 child->AddObserver(this);
53 } 52 }
54 } 53 }
55 54
56 void AlwaysOnTopController::OnWillRemoveWindow(aura::Window* child) { 55 void AlwaysOnTopController::OnWillRemoveWindow(aura::Window* child) {
57 child->RemoveObserver(this); 56 child->RemoveObserver(this);
58 } 57 }
59 58
60 void AlwaysOnTopController::OnWindowPropertyChanged(aura::Window* window, 59 void AlwaysOnTopController::OnWindowPropertyChanged(aura::Window* window,
61 const char* name, 60 const char* name,
62 void* old) { 61 void* old) {
63 if (name == aura::kAlwaysOnTopKey) { 62 if (name == aura::client::kAlwaysOnTopKey) {
64 DCHECK(window->type() == aura::WINDOW_TYPE_NORMAL || 63 DCHECK(window->type() == aura::client::WINDOW_TYPE_NORMAL ||
65 window->type() == aura::WINDOW_TYPE_POPUP); 64 window->type() == aura::client::WINDOW_TYPE_POPUP);
66 aura::Window* container = GetContainer(window); 65 aura::Window* container = GetContainer(window);
67 if (window->parent() != container) 66 if (window->parent() != container)
68 container->AddChild(window); 67 container->AddChild(window);
69 } 68 }
70 } 69 }
71 70
72 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) { 71 void AlwaysOnTopController::OnWindowDestroyed(aura::Window* window) {
73 if (window == default_container_) 72 if (window == default_container_)
74 default_container_ = NULL; 73 default_container_ = NULL;
75 if (window == always_on_top_container_) 74 if (window == always_on_top_container_)
76 always_on_top_container_ = NULL; 75 always_on_top_container_ = NULL;
77 } 76 }
78 77
79 } // namespace internal 78 } // namespace internal
80 } // namespace aura_shell 79 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/activation_controller_unittest.cc ('k') | ui/aura_shell/aura_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698