| 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 "chrome/browser/ui/views/extensions/extension_view_views.h" | 5 #include "chrome/browser/ui/views/extensions/extension_view_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 7 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
| 9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // called so the tab key events are forwarded to the renderer. | 30 // called so the tab key events are forwarded to the renderer. |
| 31 SetFocusable(true); | 31 SetFocusable(true); |
| 32 } | 32 } |
| 33 | 33 |
| 34 ExtensionViewViews::~ExtensionViewViews() { | 34 ExtensionViewViews::~ExtensionViewViews() { |
| 35 if (parent()) | 35 if (parent()) |
| 36 parent()->RemoveChildView(this); | 36 parent()->RemoveChildView(this); |
| 37 CleanUp(); | 37 CleanUp(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 gfx::Size ExtensionViewViews::GetMinimumSize() { | 40 gfx::Size ExtensionViewViews::GetMinimumSize() const { |
| 41 // If the minimum size has never been set, returns the preferred size (same | 41 // If the minimum size has never been set, returns the preferred size (same |
| 42 // behavior as views::View). | 42 // behavior as views::View). |
| 43 return (minimum_size_ == gfx::Size()) ? GetPreferredSize() : minimum_size_; | 43 return (minimum_size_ == gfx::Size()) ? GetPreferredSize() : minimum_size_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void ExtensionViewViews::SetVisible(bool is_visible) { | 46 void ExtensionViewViews::SetVisible(bool is_visible) { |
| 47 if (is_visible != visible()) { | 47 if (is_visible != visible()) { |
| 48 NativeViewHost::SetVisible(is_visible); | 48 NativeViewHost::SetVisible(is_visible); |
| 49 | 49 |
| 50 // Also tell RenderWidgetHostView the new visibility. Despite its name, it | 50 // Also tell RenderWidgetHostView the new visibility. Despite its name, it |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ExtensionViewViews::CleanUp() { | 159 void ExtensionViewViews::CleanUp() { |
| 160 if (!initialized_) | 160 if (!initialized_) |
| 161 return; | 161 return; |
| 162 if (native_view()) | 162 if (native_view()) |
| 163 Detach(); | 163 Detach(); |
| 164 initialized_ = false; | 164 initialized_ = false; |
| 165 } | 165 } |
| OLD | NEW |