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

Unified Diff: views/widget/native_widget_aura.cc

Issue 8417008: aura: Add fullscreen/popups to RenderWidgetHostViewAura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_aura.cc
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index 5e0121260e44bb44302ba6c8c65b9d5bb6712d47..7d014ad301599cb2db0d1634a5f855c040c5b6f9 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -31,7 +31,28 @@
namespace views {
-const char* const NativeWidgetAura::kWindowTypeKey = "WindowType";
+namespace {
+
+aura::WindowType GetAuraWindowTypeForWidgetType(Widget::InitParams::Type type) {
+ switch (type) {
+ case Widget::InitParams::TYPE_WINDOW:
+ return aura::WINDOW_TYPE_NORMAL;
+ case Widget::InitParams::TYPE_WINDOW_FRAMELESS:
+ case Widget::InitParams::TYPE_CONTROL:
+ case Widget::InitParams::TYPE_POPUP:
+ case Widget::InitParams::TYPE_BUBBLE:
+ return aura::WINDOW_TYPE_POPUP;
+ case Widget::InitParams::TYPE_MENU:
+ return aura::WINDOW_TYPE_MENU;
+ case Widget::InitParams::TYPE_TOOLTIP:
+ return aura::WINDOW_TYPE_TOOLTIP;
+ default:
+ NOTREACHED() << "Unhandled widget type " << type;
+ return aura::WINDOW_TYPE_UNKNOWN;
+ }
+}
+
+} // namespace
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetAura, public:
@@ -73,11 +94,13 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
window_->set_user_data(this);
Widget::InitParams::Type window_type =
params.child ? Widget::InitParams::TYPE_CONTROL : params.type;
- SetNativeWindowProperty(kWindowTypeKey, reinterpret_cast<void*>(window_type));
- window_->SetType(window_type == Widget::InitParams::TYPE_CONTROL ?
- aura::kWindowType_Control : aura::kWindowType_None);
+ window_->SetType(GetAuraWindowTypeForWidgetType(window_type));
window_->Init(params.create_texture_for_layer ?
- ui::Layer::LAYER_HAS_TEXTURE : ui::Layer::LAYER_HAS_NO_TEXTURE);
+ ui::Layer::LAYER_HAS_TEXTURE :
+ ui::Layer::LAYER_HAS_NO_TEXTURE);
+ if (window_type == Widget::InitParams::TYPE_CONTROL)
+ window_->Show();
+
// TODO(beng): respect |params| authoritah wrt transparency.
window_->layer()->SetFillsBoundsOpaquely(false);
delegate_->OnNativeWidgetCreated();
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698