| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "chrome/browser/extensions/extension_view.h" | 5 #include "chrome/browser/extensions/extension_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 if (!IsVisible()) { | 76 if (!IsVisible()) { |
| 77 pending_preferred_width_ = pref_width; | 77 pending_preferred_width_ = pref_width; |
| 78 } else if (pref_width > 0 && pref_width != GetPreferredSize().width()) { | 78 } else if (pref_width > 0 && pref_width != GetPreferredSize().width()) { |
| 79 SetPreferredSize(gfx::Size(pref_width, height())); | 79 SetPreferredSize(gfx::Size(pref_width, height())); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void ExtensionView::ViewHierarchyChanged(bool is_add, | 83 void ExtensionView::ViewHierarchyChanged(bool is_add, |
| 84 views::View *parent, | 84 views::View *parent, |
| 85 views::View *child) { | 85 views::View *child) { |
| 86 NativeViewHost::ViewHierarchyChanged(is_add, parent, child); |
| 86 if (is_add && GetWidget() && !initialized_) { | 87 if (is_add && GetWidget() && !initialized_) { |
| 87 initialized_ = true; | 88 initialized_ = true; |
| 88 | 89 |
| 89 RenderWidgetHostView* view = RenderWidgetHostView::CreateViewForWidget( | 90 RenderWidgetHostView* view = RenderWidgetHostView::CreateViewForWidget( |
| 90 render_view_host()); | 91 render_view_host()); |
| 91 | 92 |
| 92 // TODO(mpcomplete): RWHV needs a cross-platform Init function. | 93 // TODO(mpcomplete): RWHV needs a cross-platform Init function. |
| 93 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
| 94 // Create the HWND. Note: | 95 // Create the HWND. Note: |
| 95 // RenderWidgetHostHWND supports windowed plugins, but if we ever also | 96 // RenderWidgetHostHWND supports windowed plugins, but if we ever also |
| (...skipping 21 matching lines...) Expand all Loading... |
| 117 | 118 |
| 118 void ExtensionView::HandleMouseEvent() { | 119 void ExtensionView::HandleMouseEvent() { |
| 119 if (container_) | 120 if (container_) |
| 120 container_->OnExtensionMouseEvent(this); | 121 container_->OnExtensionMouseEvent(this); |
| 121 } | 122 } |
| 122 | 123 |
| 123 void ExtensionView::HandleMouseLeave() { | 124 void ExtensionView::HandleMouseLeave() { |
| 124 if (container_) | 125 if (container_) |
| 125 container_->OnExtensionMouseLeave(this); | 126 container_->OnExtensionMouseLeave(this); |
| 126 } | 127 } |
| OLD | NEW |