| 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/gtk/extensions/extension_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" | 8 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" |
| 9 #include "chrome/common/view_type.h" | |
| 10 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 11 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| 12 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 13 #include "content/public/browser/web_contents_view.h" | 12 #include "content/public/browser/web_contents_view.h" |
| 13 #include "extensions/common/view_type.h" |
| 14 | 14 |
| 15 ExtensionViewGtk::ExtensionViewGtk(extensions::ExtensionHost* extension_host, | 15 ExtensionViewGtk::ExtensionViewGtk(extensions::ExtensionHost* extension_host, |
| 16 Browser* browser) | 16 Browser* browser) |
| 17 : browser_(browser), | 17 : browser_(browser), |
| 18 extension_host_(extension_host), | 18 extension_host_(extension_host), |
| 19 container_(NULL) { | 19 container_(NULL) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void ExtensionViewGtk::Init() { | 22 void ExtensionViewGtk::Init() { |
| 23 CreateWidgetHostView(); | 23 CreateWidgetHostView(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 47 void ExtensionViewGtk::CreateWidgetHostView() { | 47 void ExtensionViewGtk::CreateWidgetHostView() { |
| 48 extension_host_->CreateRenderViewSoon(); | 48 extension_host_->CreateRenderViewSoon(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void ExtensionViewGtk::RenderViewCreated() { | 51 void ExtensionViewGtk::RenderViewCreated() { |
| 52 if (!pending_background_.empty() && render_view_host()->GetView()) { | 52 if (!pending_background_.empty() && render_view_host()->GetView()) { |
| 53 render_view_host()->GetView()->SetBackground(pending_background_); | 53 render_view_host()->GetView()->SetBackground(pending_background_); |
| 54 pending_background_.reset(); | 54 pending_background_.reset(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 chrome::ViewType host_type = extension_host_->extension_host_type(); | 57 extensions::ViewType host_type = extension_host_->extension_host_type(); |
| 58 if (host_type == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 58 if (host_type == extensions::VIEW_TYPE_EXTENSION_POPUP) { |
| 59 gfx::Size min_size(ExtensionPopupGtk::kMinWidth, | 59 gfx::Size min_size(ExtensionPopupGtk::kMinWidth, |
| 60 ExtensionPopupGtk::kMinHeight); | 60 ExtensionPopupGtk::kMinHeight); |
| 61 gfx::Size max_size(ExtensionPopupGtk::kMaxWidth, | 61 gfx::Size max_size(ExtensionPopupGtk::kMaxWidth, |
| 62 ExtensionPopupGtk::kMaxHeight); | 62 ExtensionPopupGtk::kMaxHeight); |
| 63 render_view_host()->EnableAutoResize(min_size, max_size); | 63 render_view_host()->EnableAutoResize(min_size, max_size); |
| 64 } | 64 } |
| 65 } | 65 } |
| OLD | NEW |