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

Side by Side Diff: ui/aura/desktop.cc

Issue 8082017: Change Window visibility to a simple boolean for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | ui/aura/window.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/desktop.h" 5 #include "ui/aura/desktop.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "ui/aura/desktop_host.h" 9 #include "ui/aura/desktop_host.h"
10 #include "ui/aura/focus_manager.h" 10 #include "ui/aura/focus_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void Desktop::Init() { 51 void Desktop::Init() {
52 window_->Init(); 52 window_->Init();
53 compositor()->SetRootLayer(window_->layer()); 53 compositor()->SetRootLayer(window_->layer());
54 } 54 }
55 55
56 void Desktop::CreateDefaultParentForTesting() { 56 void Desktop::CreateDefaultParentForTesting() {
57 Window* default_parent = new internal::ToplevelWindowContainer; 57 Window* default_parent = new internal::ToplevelWindowContainer;
58 default_parent->Init(); 58 default_parent->Init();
59 default_parent->SetBounds(window_->bounds()); 59 default_parent->SetBounds(window_->bounds());
60 default_parent->SetVisibility(Window::VISIBILITY_SHOWN); 60 default_parent->Show();
61 window_->AddChild(default_parent); 61 window_->AddChild(default_parent);
62 set_default_parent(default_parent); 62 set_default_parent(default_parent);
63 } 63 }
64 64
65 void Desktop::Show() { 65 void Desktop::Show() {
66 host_->Show(); 66 host_->Show();
67 } 67 }
68 68
69 void Desktop::SetSize(const gfx::Size& size) { 69 void Desktop::SetSize(const gfx::Size& size) {
70 host_->SetSize(size); 70 host_->SetSize(size);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Reset active_window_ before invoking SetActiveWindow so that we don't 129 // Reset active_window_ before invoking SetActiveWindow so that we don't
130 // attempt to notify it while running its destructor. 130 // attempt to notify it while running its destructor.
131 active_window_ = NULL; 131 active_window_ = NULL;
132 SetActiveWindow(GetTopmostWindowToActivate(window), NULL); 132 SetActiveWindow(GetTopmostWindowToActivate(window), NULL);
133 } 133 }
134 134
135 Window* Desktop::GetTopmostWindowToActivate(Window* ignore) { 135 Window* Desktop::GetTopmostWindowToActivate(Window* ignore) {
136 Window::Windows windows(default_parent_->children()); 136 Window::Windows windows(default_parent_->children());
137 for (Window::Windows::const_reverse_iterator i = windows.rbegin(); 137 for (Window::Windows::const_reverse_iterator i = windows.rbegin();
138 i != windows.rend(); ++i) { 138 i != windows.rend(); ++i) {
139 if (*i != ignore && (*i)->visibility() == Window::VISIBILITY_SHOWN && 139 if (*i != ignore && (*i)->visible() &&
140 (*i)->delegate()->ShouldActivate(NULL)) 140 (*i)->delegate()->ShouldActivate(NULL))
141 return *i; 141 return *i;
142 } 142 }
143 return NULL; 143 return NULL;
144 } 144 }
145 145
146 // static 146 // static
147 Desktop* Desktop::GetInstance() { 147 Desktop* Desktop::GetInstance() {
148 if (!instance_) { 148 if (!instance_) {
149 instance_ = new Desktop; 149 instance_ = new Desktop;
150 instance_->Init(); 150 instance_->Init();
151 } 151 }
152 return instance_; 152 return instance_;
153 } 153 }
154 154
155 } // namespace aura 155 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/demo/demo_main.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698