summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 22:47:40 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 22:47:40 +0000
commit2ca59863a57ed182b9b5a3c89b6212c10e94ec06 (patch)
tree146c5e7917ba927937bbe68f1d6c84c115aef9c1 /views
parentc128bf5477e44f1b348206bf213410c74b4be3dd (diff)
downloadchromium_src-2ca59863a57ed182b9b5a3c89b6212c10e94ec06.zip
chromium_src-2ca59863a57ed182b9b5a3c89b6212c10e94ec06.tar.gz
chromium_src-2ca59863a57ed182b9b5a3c89b6212c10e94ec06.tar.bz2
Fix constrained window on arua
add "native_view()" check in NativeTabContentsContainerAura This is necessary as native_view gets destroyed when parent window gets destroyed before tab_contents detatches the native view. type child should be added to parent. BUG=99937 TEST=manual: open http auth dialog and close. Review URL: http://codereview.chromium.org/8462001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/native/native_view_host.cc9
-rw-r--r--views/controls/native/native_view_host.h6
-rw-r--r--views/widget/native_widget_aura.cc2
3 files changed, 10 insertions, 7 deletions
diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc
index 626b45d..f507f7c 100644
--- a/views/controls/native/native_view_host.cc
+++ b/views/controls/native/native_view_host.cc
@@ -195,10 +195,11 @@ gfx::NativeViewAccessible NativeViewHost::GetNativeViewAccessible() {
// NativeViewHost, private:
void NativeViewHost::Detach(bool destroyed) {
- DCHECK(native_view_ || views_view_);
- native_wrapper_->NativeViewDetaching(destroyed);
- native_view_ = NULL;
- views_view_ = NULL;
+ if (native_view_ || views_view_) {
+ native_wrapper_->NativeViewDetaching(destroyed);
+ native_view_ = NULL;
+ views_view_ = NULL;
+ }
}
} // namespace views
diff --git a/views/controls/native/native_view_host.h b/views/controls/native/native_view_host.h
index ecb541d..180f637 100644
--- a/views/controls/native/native_view_host.h
+++ b/views/controls/native/native_view_host.h
@@ -41,8 +41,9 @@ class VIEWS_EXPORT NativeViewHost : public View {
// Attach a views::View instead of a native view to this host.
void AttachToView(View* view);
- // Detach the attached window handle. Its bounds and visibility will no longer
- // be manipulated by this View.
+ // Detach the attached native view. Its bounds and visibility will no
+ // longer be manipulated by this View. The native view may be destroyed and
+ // detached before calling this function, and this has no effect in that case.
void Detach();
// Sets a preferred size for the native view attached to this View.
@@ -100,6 +101,7 @@ class VIEWS_EXPORT NativeViewHost : public View {
// The attached view. There is exactly one native_view_ or views_view_
// attached.
+ // TODO(oshima): Delete views_view_ once TOUCH_UI migrates to aura.
View* views_view_;
// A platform-specific wrapper that does the OS-level manipulation of the
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index cb4eeba..400b457 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -136,7 +136,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
delegate_->OnNativeWidgetCreated();
window_->set_minimum_size(delegate_->GetMinimumSize());
window_->SetBounds(params.bounds);
- if (params.type == Widget::InitParams::TYPE_CONTROL) {
+ if (window_type == Widget::InitParams::TYPE_CONTROL) {
window_->SetParent(params.GetParent());
} else {
// Set up the transient child before the window is added. This way the