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

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

Issue 8387043: [Aura] Support always-on-top top level window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
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/shell.h" 5 #include "ui/aura_shell/shell.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/aura/desktop.h" 8 #include "ui/aura/desktop.h"
9 #include "ui/aura/screen_aura.h" 9 #include "ui/aura/screen_aura.h"
10 #include "ui/aura/toplevel_window_container.h" 10 #include "ui/aura/toplevel_window_container.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void Shell::AddChildToDefaultParent(aura::Window* window) { 156 void Shell::AddChildToDefaultParent(aura::Window* window) {
157 aura::Window* parent = NULL; 157 aura::Window* parent = NULL;
158 intptr_t type = reinterpret_cast<intptr_t>( 158 intptr_t type = reinterpret_cast<intptr_t>(
159 ui::ViewProp::GetValue(window, views::NativeWidgetAura::kWindowTypeKey)); 159 ui::ViewProp::GetValue(window, views::NativeWidgetAura::kWindowTypeKey));
160 switch (static_cast<Widget::InitParams::Type>(type)) { 160 switch (static_cast<Widget::InitParams::Type>(type)) {
161 case Widget::InitParams::TYPE_WINDOW: 161 case Widget::InitParams::TYPE_WINDOW:
162 case Widget::InitParams::TYPE_WINDOW_FRAMELESS: 162 case Widget::InitParams::TYPE_WINDOW_FRAMELESS:
163 case Widget::InitParams::TYPE_CONTROL: 163 case Widget::InitParams::TYPE_CONTROL:
164 case Widget::InitParams::TYPE_BUBBLE: 164 case Widget::InitParams::TYPE_BUBBLE:
165 case Widget::InitParams::TYPE_POPUP: 165 case Widget::InitParams::TYPE_POPUP:
166 parent = GetContainer(internal::kShellWindowId_DefaultContainer); 166 if (!!window->GetProperty(aura::Window::kPropAlwaysOnTop))
167 parent = GetContainer(internal::kShellWindowId_AlwaysOnTopContainer);
168 else
169 parent = GetContainer(internal::kShellWindowId_DefaultContainer);
167 break; 170 break;
168 case Widget::InitParams::TYPE_MENU: 171 case Widget::InitParams::TYPE_MENU:
169 case Widget::InitParams::TYPE_TOOLTIP: 172 case Widget::InitParams::TYPE_TOOLTIP:
170 parent = GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer); 173 parent = GetContainer(internal::kShellWindowId_MenusAndTooltipsContainer);
171 break; 174 break;
172 default: 175 default:
173 // This will crash for controls, since they can't be parented to anything. 176 // This will crash for controls, since they can't be parented to anything.
174 break; 177 break;
175 } 178 }
176 parent->AddChild(window); 179 parent->AddChild(window);
177 } 180 }
178 181
179 aura::Window* Shell::GetTopmostWindowToActivate(aura::Window* ignore) const { 182 aura::Window* Shell::GetTopmostWindowToActivate(aura::Window* ignore) const {
180 const aura::ToplevelWindowContainer* container = 183 const aura::ToplevelWindowContainer* container =
181 GetContainer(internal::kShellWindowId_DefaultContainer)-> 184 GetContainer(internal::kShellWindowId_DefaultContainer)->
182 AsToplevelWindowContainer(); 185 AsToplevelWindowContainer();
183 return container->GetTopmostWindowToActivate(ignore); 186 return container->GetTopmostWindowToActivate(ignore);
184 } 187 }
185 188
186 } // namespace aura_shell 189 } // namespace aura_shell
OLDNEW
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698