summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 09:19:40 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-12 09:19:40 +0000
commiteeb92a5123019390ec81acdcabf675168eb520bd (patch)
treec59ef32e2e33707dabd40ca7e0021b189a3b3e56 /views/widget
parent82b8c96729af0c7af2e9fa752aa20b158ebf3701 (diff)
downloadchromium_src-eeb92a5123019390ec81acdcabf675168eb520bd.zip
chromium_src-eeb92a5123019390ec81acdcabf675168eb520bd.tar.gz
chromium_src-eeb92a5123019390ec81acdcabf675168eb520bd.tar.bz2
Enable NativeConstrainedWindowAura
Implement NativeWidgetAura::CenterWindow. The content of the html dialog is current blank due to a bug somewhere else. I'll address it in separate CL. BUG=none TEST=none Review URL: http://codereview.chromium.org/8224020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_aura.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index 76e34c9..bfd603f 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -32,8 +32,10 @@ namespace views {
namespace {
-int GetAuraWindowTypeForWidgetType(Widget::InitParams::Type type) {
- switch (type) {
+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:
@@ -92,7 +94,7 @@ gfx::Font NativeWidgetAura::GetWindowTitleFont() {
void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
ownership_ = params.ownership;
window_->set_user_data(this);
- window_->SetType(GetAuraWindowTypeForWidgetType(params.type));
+ window_->SetType(GetAuraWindowTypeFromInitParams(params));
window_->Init();
// TODO(beng): respect |params| authoritah wrt transparency.
window_->layer()->SetFillsBoundsOpaquely(false);
@@ -221,7 +223,11 @@ InputMethod* NativeWidgetAura::CreateInputMethod() {
}
void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
- NOTIMPLEMENTED();
+ const gfx::Rect parent_bounds = window_->parent()->bounds();
+ window_->SetBounds(gfx::Rect((parent_bounds.width() - size.width())/2,
+ (parent_bounds.height() - size.height())/2,
+ size.width(),
+ size.height()));
}
void NativeWidgetAura::GetWindowPlacement(