Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_view_mac.mm

Issue 10961066: Revert 158199 - extensions: Add ExtensionView interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/extension_view_mac.mm
===================================================================
--- chrome/browser/ui/cocoa/extensions/extension_view_mac.mm (revision 158218)
+++ chrome/browser/ui/cocoa/extensions/extension_view_mac.mm (working copy)
@@ -7,7 +7,6 @@
#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h"
#include "chrome/browser/extensions/extension_host.h"
-#include "chrome/browser/extensions/extension_view_container.h"
#include "chrome/common/view_type.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -26,7 +25,7 @@
extension_host_(extension_host),
container_(NULL) {
DCHECK(extension_host_);
- [GetNativeView() setHidden:YES];
+ [native_view() setHidden:YES];
}
ExtensionViewMac::~ExtensionViewMac() {
@@ -36,43 +35,35 @@
CreateWidgetHostView();
}
-void ExtensionViewMac::SetBackground(const SkBitmap& background) {
- if (!pending_background_.empty() && GetRenderViewHost()->GetView()) {
- GetRenderViewHost()->GetView()->SetBackground(background);
- } else {
- pending_background_ = background;
- }
- ShowIfCompletelyLoaded();
-}
-
-Browser* ExtensionViewMac::GetBrowser() {
- return browser_;
-}
-
-const Browser* ExtensionViewMac::GetBrowser() const {
- return browser_;
-}
-
-gfx::NativeView ExtensionViewMac::GetNativeView() {
+gfx::NativeView ExtensionViewMac::native_view() {
return extension_host_->host_contents()->GetView()->GetNativeView();
}
-content::RenderViewHost* ExtensionViewMac::GetRenderViewHost() const {
+content::RenderViewHost* ExtensionViewMac::render_view_host() const {
return extension_host_->render_view_host();
}
-void ExtensionViewMac::SetContainer(ExtensionViewContainer* container) {
- container_ = container;
+void ExtensionViewMac::DidStopLoading() {
+ ShowIfCompletelyLoaded();
}
+void ExtensionViewMac::SetBackground(const SkBitmap& background) {
+ if (!pending_background_.empty() && render_view_host()->GetView()) {
+ render_view_host()->GetView()->SetBackground(background);
+ } else {
+ pending_background_ = background;
+ }
+ ShowIfCompletelyLoaded();
+}
+
void ExtensionViewMac::ResizeDueToAutoResize(const gfx::Size& new_size) {
if (container_)
container_->OnExtensionSizeChanged(this, new_size);
}
void ExtensionViewMac::RenderViewCreated() {
- if (!pending_background_.empty() && GetRenderViewHost()->GetView()) {
- GetRenderViewHost()->GetView()->SetBackground(pending_background_);
+ if (!pending_background_.empty() && render_view_host()->GetView()) {
+ render_view_host()->GetView()->SetBackground(pending_background_);
pending_background_.reset();
}
@@ -82,17 +73,13 @@
ExtensionViewMac::kMinHeight);
gfx::Size max_size(ExtensionViewMac::kMaxWidth,
ExtensionViewMac::kMaxHeight);
- GetRenderViewHost()->EnableAutoResize(min_size, max_size);
+ render_view_host()->EnableAutoResize(min_size, max_size);
}
}
-void ExtensionViewMac::DidStopLoading() {
- ShowIfCompletelyLoaded();
-}
-
void ExtensionViewMac::WindowFrameChanged() {
- if (GetRenderViewHost()->GetView())
- GetRenderViewHost()->GetView()->WindowFrameChanged();
+ if (render_view_host()->GetView())
+ render_view_host()->GetView()->WindowFrameChanged();
}
void ExtensionViewMac::CreateWidgetHostView() {
@@ -103,16 +90,8 @@
// We wait to show the ExtensionView until it has loaded, and the view has
// actually been created. These can happen in different orders.
if (extension_host_->did_stop_loading()) {
- [GetNativeView() setHidden:NO];
+ [native_view() setHidden:NO];
if (container_)
container_->OnExtensionViewDidShow(this);
}
}
-
-// static
-ExtensionView* ExtensionView::Create(extensions::ExtensionHost* host,
- Browser* browser) {
- ExtensionViewMac* extension_view = new ExtensionViewMac(host, browser);
- extension_view->Init();
- return extension_view;
-}

Powered by Google App Engine
This is Rietveld 408576698