diff options
author | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 19:36:45 +0000 |
---|---|---|
committer | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 19:36:45 +0000 |
commit | 3f02dc593923bfb7897b2efe764151bd7a469e1a (patch) | |
tree | d094ffc1693d9899488bd8adeaecae31d7fe514f /views | |
parent | 0dc567495088bae351da07b5d2eaf7e201c50168 (diff) | |
download | chromium_src-3f02dc593923bfb7897b2efe764151bd7a469e1a.zip chromium_src-3f02dc593923bfb7897b2efe764151bd7a469e1a.tar.gz chromium_src-3f02dc593923bfb7897b2efe764151bd7a469e1a.tar.bz2 |
LayoutManager controls child bounds. Added SetChildBounds and several listener methods to LayoutManager class. They will be used to implement more sophisticated behavior.
Implemented DefaultContainerLayoutManager.
Added test_support_aura component so that it can be shared
between aura and aura_shell.
Fixed component build for aura_shell_unittests
BUG=none
TEST=default_container_layout_manager_unittests.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=106508
Review URL: http://codereview.chromium.org/8296002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/native_widget_aura.cc | 32 | ||||
-rw-r--r-- | views/widget/native_widget_aura.h | 4 |
2 files changed, 10 insertions, 26 deletions
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc index 5e97cff..cc1baa1 100644 --- a/views/widget/native_widget_aura.cc +++ b/views/widget/native_widget_aura.cc @@ -33,31 +33,7 @@ using ui::ViewProp; namespace views { -namespace { - -int GetAuraWindowTypeFromInitParams(const Widget::InitParams& params) { - if (params.child) - return aura::kWindowType_Control; - switch (params.type) { - case Widget::InitParams::TYPE_WINDOW: - case Widget::InitParams::TYPE_WINDOW_FRAMELESS: - case Widget::InitParams::TYPE_POPUP: - case Widget::InitParams::TYPE_BUBBLE: - return aura::kWindowType_Toplevel; - case Widget::InitParams::TYPE_CONTROL: - return aura::kWindowType_Control; - case Widget::InitParams::TYPE_MENU: - return aura::kWindowType_Menu; - case Widget::InitParams::TYPE_TOOLTIP: - return aura::kWindowType_Tooltip; - default: - NOTREACHED(); - break; - } - return aura::kWindowType_Toplevel; -} - -} // namespace +const char* const NativeWidgetAura::kWindowTypeKey = "WindowType"; //////////////////////////////////////////////////////////////////////////////// // NativeWidgetAura, public: @@ -97,7 +73,11 @@ gfx::Font NativeWidgetAura::GetWindowTitleFont() { void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { ownership_ = params.ownership; window_->set_user_data(this); - window_->SetType(GetAuraWindowTypeFromInitParams(params)); + 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_->Init(); // TODO(beng): respect |params| authoritah wrt transparency. window_->layer()->SetFillsBoundsOpaquely(false); diff --git a/views/widget/native_widget_aura.h b/views/widget/native_widget_aura.h index 9ba5f86..255b123 100644 --- a/views/widget/native_widget_aura.h +++ b/views/widget/native_widget_aura.h @@ -142,6 +142,10 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, virtual void OnWindowDestroyed() OVERRIDE; virtual void OnWindowVisibilityChanged(bool visible) OVERRIDE; + // ViewProp key for window type. The prop value is one of + // Widget::InitParams::Type. + static const char* const kWindowTypeKey; + private: typedef ScopedVector<ui::ViewProp> ViewProps; |