| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 #endif // OS_WIN | 407 #endif // OS_WIN |
| 408 | 408 |
| 409 if (!use_non_toplevel_window && !native_widget_factory().is_null()) { | 409 if (!use_non_toplevel_window && !native_widget_factory().is_null()) { |
| 410 params->native_widget = native_widget_factory().Run(*params, delegate); | 410 params->native_widget = native_widget_factory().Run(*params, delegate); |
| 411 return; | 411 return; |
| 412 } | 412 } |
| 413 #endif // USE_AURA | 413 #endif // USE_AURA |
| 414 | 414 |
| 415 #if defined(OS_CHROMEOS) || defined(USE_ASH) | 415 #if defined(OS_CHROMEOS) || defined(USE_ASH) |
| 416 // Mash lets the window server decide the default parent and default display |
| 417 // for new widgets. |
| 418 if (chrome::IsRunningInMash()) |
| 419 return; |
| 420 |
| 416 // When we are doing straight chromeos builds, we still need to handle the | 421 // When we are doing straight chromeos builds, we still need to handle the |
| 417 // toplevel window case. | 422 // toplevel window case. |
| 418 // There may be a few remaining widgets in Chrome OS that are not top level, | 423 // There may be a few remaining widgets in Chrome OS that are not top level, |
| 419 // but have neither a context nor a parent. Provide a fallback context so | 424 // but have neither a context nor a parent. Provide a fallback context so |
| 420 // users don't crash. Developers will hit the DCHECK and should provide a | 425 // users don't crash. Developers will hit the DCHECK and should provide a |
| 421 // context. | 426 // context. |
| 422 if (params->context) | 427 if (params->context) |
| 423 params->context = params->context->GetRootWindow(); | 428 params->context = params->context->GetRootWindow(); |
| 424 DCHECK(params->parent || params->context || !params->child) | 429 DCHECK(params->parent || params->context || !params->child) |
| 425 << "Please provide a parent or context for this widget."; | 430 << "Please provide a parent or context for this widget."; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 return content::BrowserThread::GetBlockingPool(); | 514 return content::BrowserThread::GetBlockingPool(); |
| 510 } | 515 } |
| 511 | 516 |
| 512 #if !defined(USE_ASH) | 517 #if !defined(USE_ASH) |
| 513 views::Widget::InitParams::WindowOpacity | 518 views::Widget::InitParams::WindowOpacity |
| 514 ChromeViewsDelegate::GetOpacityForInitParams( | 519 ChromeViewsDelegate::GetOpacityForInitParams( |
| 515 const views::Widget::InitParams& params) { | 520 const views::Widget::InitParams& params) { |
| 516 return views::Widget::InitParams::OPAQUE_WINDOW; | 521 return views::Widget::InitParams::OPAQUE_WINDOW; |
| 517 } | 522 } |
| 518 #endif | 523 #endif |
| OLD | NEW |