| OLD | NEW |
| 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 "chrome/browser/ui/views/chrome_views_delegate.h" | 5 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 break; | 207 break; |
| 208 #if defined(USE_ASH) | 208 #if defined(USE_ASH) |
| 209 case chrome::HOST_DESKTOP_TYPE_ASH: | 209 case chrome::HOST_DESKTOP_TYPE_ASH: |
| 210 // If we're in ash, give this window the context of the main monitor. | 210 // If we're in ash, give this window the context of the main monitor. |
| 211 params->context = ash::Shell::GetPrimaryRootWindow(); | 211 params->context = ash::Shell::GetPrimaryRootWindow(); |
| 212 break; | 212 break; |
| 213 #endif | 213 #endif |
| 214 default: | 214 default: |
| 215 NOTREACHED(); | 215 NOTREACHED(); |
| 216 } | 216 } |
| 217 #if defined(OS_WIN) && defined(USE_AURA) |
| 218 } else if (chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH && |
| 219 params->parent && |
| 220 (params->type == views::Widget::InitParams::TYPE_CONTROL || |
| 221 params->type == views::Widget::InitParams::TYPE_WINDOW)) { |
| 222 // On Aura Desktop, we want most windows (popups, bubbles, regular top |
| 223 // level windows) not to be handled in this function. They'll get a |
| 224 // DesktopNativeWidgetAura created. For controls, and child windows (e.g. |
| 225 // modal dialogs) we want to create a NativeWidgetAura, which will be |
| 226 // inside the parent. |
| 227 #else |
| 217 } else if (params->parent && | 228 } else if (params->parent && |
| 218 params->type != views::Widget::InitParams::TYPE_MENU) { | 229 params->type != views::Widget::InitParams::TYPE_MENU) { |
| 230 #endif |
| 219 params->native_widget = new views::NativeWidgetAura(delegate); | 231 params->native_widget = new views::NativeWidgetAura(delegate); |
| 220 } else if (params->type != views::Widget::InitParams::TYPE_TOOLTIP) { | 232 } else if (params->type != views::Widget::InitParams::TYPE_TOOLTIP) { |
| 221 // TODO(erg): Once we've threaded context to everywhere that needs it, we | 233 // TODO(erg): Once we've threaded context to everywhere that needs it, we |
| 222 // should remove this check here. | 234 // should remove this check here. |
| 223 gfx::NativeView to_check = | 235 gfx::NativeView to_check = |
| 224 params->context ? params->context : params->parent; | 236 params->context ? params->context : params->parent; |
| 225 if (chrome::GetHostDesktopTypeForNativeView(to_check) == | 237 if (chrome::GetHostDesktopTypeForNativeView(to_check) == |
| 226 chrome::HOST_DESKTOP_TYPE_NATIVE) { | 238 chrome::HOST_DESKTOP_TYPE_NATIVE) { |
| 227 params->native_widget = new views::DesktopNativeWidgetAura(delegate); | 239 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
| 228 } | 240 } |
| 229 } | 241 } |
| 230 #endif | 242 #endif |
| 231 } | 243 } |
| OLD | NEW |