summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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