Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/native/native_view_host.h" | 5 #include "views/controls/native/native_view_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
| 9 #include "views/controls/native/native_view_host_views.h" | 9 #include "views/controls/native/native_view_host_views.h" |
| 10 #include "views/controls/native/native_view_host_wrapper.h" | 10 #include "views/controls/native/native_view_host_wrapper.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 } | 145 } |
| 146 | 146 |
| 147 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { | 147 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { |
| 148 Layout(); | 148 Layout(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool NativeViewHost::NeedsNotificationWhenVisibleBoundsChange() const { | 151 bool NativeViewHost::NeedsNotificationWhenVisibleBoundsChange() const { |
| 152 // The native widget is placed relative to the root. As such, we need to | 152 // The native widget is placed relative to the root. As such, we need to |
| 153 // know when the position of any ancestor changes, or our visibility relative | 153 // know when the position of any ancestor changes, or our visibility relative |
| 154 // to other views changed as it'll effect our position relative to the root. | 154 // to other views changed as it'll effect our position relative to the root. |
| 155 #if !defined(USE_AURA) | |
| 155 return true; | 156 return true; |
| 157 #else | |
| 158 return false; | |
|
sky
2011/10/27 14:40:47
This comment seems to apply to aura. Why do we wan
DaveMoore
2011/10/27 21:25:13
Do we need this when there's only one native windo
sky
2011/10/27 22:12:20
We still have child windows for the TabContents an
DaveMoore
2011/10/28 16:46:48
Done.
| |
| 159 #endif | |
| 156 } | 160 } |
| 157 | 161 |
| 158 void NativeViewHost::OnVisibleBoundsChanged() { | 162 void NativeViewHost::OnVisibleBoundsChanged() { |
| 159 Layout(); | 163 Layout(); |
| 160 } | 164 } |
| 161 | 165 |
| 162 void NativeViewHost::ViewHierarchyChanged(bool is_add, View* parent, | 166 void NativeViewHost::ViewHierarchyChanged(bool is_add, View* parent, |
| 163 View* child) { | 167 View* child) { |
| 164 if (is_add && GetWidget()) { | 168 if (is_add && GetWidget()) { |
| 165 if (!native_wrapper_.get()) | 169 if (!native_wrapper_.get()) |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 195 // NativeViewHost, private: | 199 // NativeViewHost, private: |
| 196 | 200 |
| 197 void NativeViewHost::Detach(bool destroyed) { | 201 void NativeViewHost::Detach(bool destroyed) { |
| 198 DCHECK(native_view_ || views_view_); | 202 DCHECK(native_view_ || views_view_); |
| 199 native_wrapper_->NativeViewDetaching(destroyed); | 203 native_wrapper_->NativeViewDetaching(destroyed); |
| 200 native_view_ = NULL; | 204 native_view_ = NULL; |
| 201 views_view_ = NULL; | 205 views_view_ = NULL; |
| 202 } | 206 } |
| 203 | 207 |
| 204 } // namespace views | 208 } // namespace views |
| OLD | NEW |