| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/native/native_view_host.h" | 5 #include "ui/views/controls/native/native_view_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/base/cursor/cursor.h" | 8 #include "ui/base/cursor/cursor.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 #include "ui/views/accessibility/native_view_accessibility.h" | 10 #include "ui/views/accessibility/native_view_accessibility.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 void NativeViewHost::NativeViewDestroyed() { | 59 void NativeViewHost::NativeViewDestroyed() { |
| 60 // Detach so we can clear our state and notify the native_wrapper_ to release | 60 // Detach so we can clear our state and notify the native_wrapper_ to release |
| 61 // ref on the native view. | 61 // ref on the native view. |
| 62 Detach(true); | 62 Detach(true); |
| 63 } | 63 } |
| 64 | 64 |
| 65 //////////////////////////////////////////////////////////////////////////////// | 65 //////////////////////////////////////////////////////////////////////////////// |
| 66 // NativeViewHost, View overrides: | 66 // NativeViewHost, View overrides: |
| 67 | 67 |
| 68 gfx::Size NativeViewHost::GetPreferredSize() { | 68 gfx::Size NativeViewHost::GetPreferredSize() const { |
| 69 return preferred_size_; | 69 return preferred_size_; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void NativeViewHost::Layout() { | 72 void NativeViewHost::Layout() { |
| 73 if (!native_view_ || !native_wrapper_.get()) | 73 if (!native_view_ || !native_wrapper_.get()) |
| 74 return; | 74 return; |
| 75 | 75 |
| 76 gfx::Rect vis_bounds = GetVisibleBounds(); | 76 gfx::Rect vis_bounds = GetVisibleBounds(); |
| 77 bool visible = !vis_bounds.IsEmpty(); | 77 bool visible = !vis_bounds.IsEmpty(); |
| 78 | 78 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 Widget::Widgets widgets; | 215 Widget::Widgets widgets; |
| 216 Widget::GetAllChildWidgets(native_view(), &widgets); | 216 Widget::GetAllChildWidgets(native_view(), &widgets); |
| 217 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { | 217 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { |
| 218 focus_manager->ViewRemoved((*i)->GetRootView()); | 218 focus_manager->ViewRemoved((*i)->GetRootView()); |
| 219 if (!focus_manager->GetFocusedView()) | 219 if (!focus_manager->GetFocusedView()) |
| 220 return; | 220 return; |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace views | 224 } // namespace views |
| OLD | NEW |