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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // There may be a few remaining widgets in Chrome OS that are not top level, | 236 // There may be a few remaining widgets in Chrome OS that are not top level, |
237 // but have neither a context nor a parent. Provide a fallback context so | 237 // but have neither a context nor a parent. Provide a fallback context so |
238 // users don't crash. Developers will hit the DCHECK and should provide a | 238 // users don't crash. Developers will hit the DCHECK and should provide a |
239 // context. | 239 // context. |
240 DCHECK(params->parent || params->context || params->top_level) | 240 DCHECK(params->parent || params->context || params->top_level) |
241 << "Please provide a parent or context for this widget."; | 241 << "Please provide a parent or context for this widget."; |
242 if (!params->parent && !params->context) | 242 if (!params->parent && !params->context) |
243 params->context = ash::Shell::GetPrimaryRootWindow(); | 243 params->context = ash::Shell::GetPrimaryRootWindow(); |
244 #elif defined(USE_AURA) | 244 #elif defined(USE_AURA) |
245 // While the majority of the time, context wasn't plumbed through due to the | 245 // While the majority of the time, context wasn't plumbed through due to the |
246 // existence of a global StackingClient, if this window is a toplevel, it's | 246 // existence of a global WindowTreeClient, if this window is a toplevel, it's |
247 // possible that there is no contextual state that we can use. | 247 // possible that there is no contextual state that we can use. |
248 if (params->parent == NULL && params->context == NULL && params->top_level) { | 248 if (params->parent == NULL && params->context == NULL && params->top_level) { |
249 // We need to make a decision about where to place this window based on the | 249 // We need to make a decision about where to place this window based on the |
250 // desktop type. | 250 // desktop type. |
251 switch (chrome::GetActiveDesktop()) { | 251 switch (chrome::GetActiveDesktop()) { |
252 case chrome::HOST_DESKTOP_TYPE_NATIVE: | 252 case chrome::HOST_DESKTOP_TYPE_NATIVE: |
253 // If we're native, we should give this window its own toplevel desktop | 253 // If we're native, we should give this window its own toplevel desktop |
254 // widget. | 254 // widget. |
255 params->native_widget = new views::DesktopNativeWidgetAura(delegate); | 255 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
256 break; | 256 break; |
(...skipping 20 matching lines...) Expand all Loading... |
277 } | 277 } |
278 #endif | 278 #endif |
279 } | 279 } |
280 | 280 |
281 #if !defined(OS_CHROMEOS) | 281 #if !defined(OS_CHROMEOS) |
282 base::TimeDelta | 282 base::TimeDelta |
283 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { | 283 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { |
284 return base::TimeDelta(); | 284 return base::TimeDelta(); |
285 } | 285 } |
286 #endif | 286 #endif |
OLD | NEW |