Skip to content

Commit

Permalink
Move RenderViewHostDelegateViewHelper to content.
Browse files Browse the repository at this point in the history
Rename to be something less of a tongue-twister.

BUG=93804, 95573
TEST=no visible change

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=117220

Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=117222

Review URL: http://codereview.chromium.org/9114047

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117277 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
avi@chromium.org committed Jan 11, 2012
1 parent 6d6f83b commit d976c35
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 89 deletions.
36 changes: 18 additions & 18 deletions chrome/browser/tab_contents/tab_contents_view_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,45 +333,45 @@ gboolean TabContentsViewGtk::OnFocus(GtkWidget* widget,
void TabContentsViewGtk::CreateNewWindow(
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {
delegate_view_helper_.CreateNewWindow(tab_contents_, route_id, params);
tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params);
}

void TabContentsViewGtk::CreateNewWidget(
int route_id, WebKit::WebPopupType popup_type) {
delegate_view_helper_.CreateNewWidget(tab_contents_,
route_id,
false,
popup_type);
tab_contents_view_helper_.CreateNewWidget(tab_contents_,
route_id,
false,
popup_type);
}

void TabContentsViewGtk::CreateNewFullscreenWidget(int route_id) {
delegate_view_helper_.CreateNewWidget(tab_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);
tab_contents_view_helper_.CreateNewWidget(tab_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);
}

void TabContentsViewGtk::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture) {
delegate_view_helper_.ShowCreatedWindow(
tab_contents_view_helper_.ShowCreatedWindow(
tab_contents_, route_id, disposition, initial_pos, user_gesture);
}

void TabContentsViewGtk::ShowCreatedWidget(
int route_id, const gfx::Rect& initial_pos) {
delegate_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
false,
initial_pos);
tab_contents_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
false,
initial_pos);
}

void TabContentsViewGtk::ShowCreatedFullscreenWidget(int route_id) {
delegate_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
true,
gfx::Rect());
tab_contents_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
true,
gfx::Rect());
}

void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/tab_contents/tab_contents_view_gtk.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -11,8 +11,8 @@
#include <vector>

#include "base/memory/scoped_ptr.h"
#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/browser/tab_contents/tab_contents_view_helper.h"
#include "ui/base/gtk/focus_store_gtk.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/owned_widget_gtk.h"
Expand Down Expand Up @@ -128,8 +128,8 @@ class TabContentsViewGtk : public TabContentsView {
// The TabContents whose contents we display.
TabContents* tab_contents_;

// Common implementations of some RenderViewHostDelegate::View methods.
RenderViewHostDelegateViewHelper delegate_view_helper_;
// Common implementations of some TabContentsView methods.
TabContentsViewHelper tab_contents_view_helper_;

// This container holds the tab's web page views. It is a GtkExpandedContainer
// so that we can control the size of the web pages.
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/tab_contents/tab_contents_view_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#include "base/memory/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/browser/tab_contents/tab_contents_view_helper.h"
#include "ui/base/cocoa/base_view.h"
#include "ui/gfx/size.h"

Expand Down Expand Up @@ -128,8 +128,8 @@ class TabContentsViewMac : public TabContentsView {
// The TabContents whose contents we display.
TabContents* tab_contents_;

// Common implementations of some RenderViewHostDelegate::View methods.
RenderViewHostDelegateViewHelper delegate_view_helper_;
// Common implementations of some TabContentsView methods.
TabContentsViewHelper tab_contents_view_helper_;

// The Cocoa NSView that lives in the view hierarchy.
scoped_nsobject<TabContentsViewCocoa> cocoa_view_;
Expand Down
36 changes: 18 additions & 18 deletions chrome/browser/tab_contents/tab_contents_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,16 @@ - (void)renderWidgetHostWasResized;
void TabContentsViewMac::CreateNewWindow(
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {
delegate_view_helper_.CreateNewWindow(tab_contents_, route_id, params);
tab_contents_view_helper_.CreateNewWindow(tab_contents_, route_id, params);
}

void TabContentsViewMac::CreateNewWidget(
int route_id, WebKit::WebPopupType popup_type) {
RenderWidgetHostView* widget_view =
delegate_view_helper_.CreateNewWidget(tab_contents_,
route_id,
false,
popup_type);
tab_contents_view_helper_.CreateNewWidget(tab_contents_,
route_id,
false,
popup_type);

// A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it
// to allow it to survive the trip without being hosted.
Expand All @@ -292,10 +292,10 @@ - (void)renderWidgetHostWasResized;

void TabContentsViewMac::CreateNewFullscreenWidget(int route_id) {
RenderWidgetHostView* widget_view =
delegate_view_helper_.CreateNewWidget(tab_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);
tab_contents_view_helper_.CreateNewWidget(tab_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);

// A RenderWidgetHostViewMac has lifetime scoped to the view. We'll retain it
// to allow it to survive the trip without being hosted.
Expand All @@ -308,17 +308,17 @@ - (void)renderWidgetHostWasResized;
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture) {
delegate_view_helper_.ShowCreatedWindow(
tab_contents_view_helper_.ShowCreatedWindow(
tab_contents_, route_id, disposition, initial_pos, user_gesture);
}

void TabContentsViewMac::ShowCreatedWidget(
int route_id, const gfx::Rect& initial_pos) {
RenderWidgetHostView* widget_host_view =
delegate_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
false,
initial_pos);
tab_contents_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
false,
initial_pos);

// A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's
// properly embedded (or purposefully ignored) we can release the retain we
Expand All @@ -330,10 +330,10 @@ - (void)renderWidgetHostWasResized;

void TabContentsViewMac::ShowCreatedFullscreenWidget(int route_id) {
RenderWidgetHostView* widget_host_view =
delegate_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
true,
gfx::Rect());
tab_contents_view_helper_.ShowCreatedWidget(tab_contents_,
route_id,
true,
gfx::Rect());

// A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's
// properly embedded (or purposely ignored) we can release the retain we took
Expand Down
36 changes: 18 additions & 18 deletions chrome/browser/ui/views/tab_contents/tab_contents_view_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,45 +301,45 @@ void TabContentsViewViews::CloseTab() {
void TabContentsViewViews::CreateNewWindow(
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {
delegate_view_helper_.CreateNewWindow(web_contents_, route_id, params);
tab_contents_view_helper_.CreateNewWindow(web_contents_, route_id, params);
}

void TabContentsViewViews::CreateNewWidget(
int route_id, WebKit::WebPopupType popup_type) {
delegate_view_helper_.CreateNewWidget(web_contents_,
route_id,
false,
popup_type);
tab_contents_view_helper_.CreateNewWidget(web_contents_,
route_id,
false,
popup_type);
}

void TabContentsViewViews::CreateNewFullscreenWidget(int route_id) {
delegate_view_helper_.CreateNewWidget(web_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);
tab_contents_view_helper_.CreateNewWidget(web_contents_,
route_id,
true,
WebKit::WebPopupTypeNone);
}

void TabContentsViewViews::ShowCreatedWindow(int route_id,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
bool user_gesture) {
delegate_view_helper_.ShowCreatedWindow(
tab_contents_view_helper_.ShowCreatedWindow(
web_contents_, route_id, disposition, initial_pos, user_gesture);
}

void TabContentsViewViews::ShowCreatedWidget(
int route_id, const gfx::Rect& initial_pos) {
delegate_view_helper_.ShowCreatedWidget(web_contents_,
route_id,
false,
initial_pos);
tab_contents_view_helper_.ShowCreatedWidget(web_contents_,
route_id,
false,
initial_pos);
}

void TabContentsViewViews::ShowCreatedFullscreenWidget(int route_id) {
delegate_view_helper_.ShowCreatedWidget(web_contents_,
route_id,
true,
gfx::Rect());
tab_contents_view_helper_.ShowCreatedWidget(web_contents_,
route_id,
true,
gfx::Rect());
}

void TabContentsViewViews::ShowContextMenu(const ContextMenuParams& params) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -9,9 +9,9 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/browser/tab_contents/tab_contents_view_helper.h"
#include "ui/views/widget/widget.h"

class ConstrainedWindowGtk;
Expand Down Expand Up @@ -147,8 +147,8 @@ class TabContentsViewViews : public views::Widget,
// The WebContents whose contents we display.
content::WebContents* web_contents_;

// Common implementations of some RenderViewHostDelegate::View methods.
RenderViewHostDelegateViewHelper delegate_view_helper_;
// Common implementations of some TabContentsView methods.
TabContentsViewHelper tab_contents_view_helper_;

NativeTabContentsView* native_tab_contents_view_;

Expand Down
2 changes: 0 additions & 2 deletions chrome/chrome_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2365,8 +2365,6 @@
'browser/tab_contents/render_view_context_menu_mac.mm',
'browser/tab_contents/render_view_context_menu_observer.cc',
'browser/tab_contents/render_view_context_menu_observer.h',
'browser/tab_contents/render_view_host_delegate_helper.cc',
'browser/tab_contents/render_view_host_delegate_helper.h',
'browser/tab_contents/retargeting_details.h',
'browser/tab_contents/tab_contents_ssl_helper.cc',
'browser/tab_contents/tab_contents_ssl_helper.h',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "content/browser/tab_contents/tab_contents_view_helper.h"

#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host.h"
Expand All @@ -18,15 +18,15 @@

using content::WebContents;

RenderViewHostDelegateViewHelper::RenderViewHostDelegateViewHelper() {
TabContentsViewHelper::TabContentsViewHelper() {
registrar_.Add(this,
content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
content::NotificationService::AllBrowserContextsAndSources());
}

RenderViewHostDelegateViewHelper::~RenderViewHostDelegateViewHelper() {}
TabContentsViewHelper::~TabContentsViewHelper() {}

void RenderViewHostDelegateViewHelper::Observe(
void TabContentsViewHelper::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
Expand All @@ -41,7 +41,7 @@ void RenderViewHostDelegateViewHelper::Observe(
}
}

TabContents* RenderViewHostDelegateViewHelper::CreateNewWindow(
TabContents* TabContentsViewHelper::CreateNewWindow(
WebContents* web_contents,
int route_id,
const ViewHostMsg_CreateWindow_Params& params) {
Expand Down Expand Up @@ -85,7 +85,7 @@ TabContents* RenderViewHostDelegateViewHelper::CreateNewWindow(
return new_contents;
}

RenderWidgetHostView* RenderViewHostDelegateViewHelper::CreateNewWidget(
RenderWidgetHostView* TabContentsViewHelper::CreateNewWidget(
WebContents* web_contents,
int route_id,
bool is_fullscreen,
Expand All @@ -103,7 +103,7 @@ RenderWidgetHostView* RenderViewHostDelegateViewHelper::CreateNewWidget(
return widget_view;
}

TabContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) {
TabContents* TabContentsViewHelper::GetCreatedWindow(int route_id) {
PendingContents::iterator iter = pending_contents_.find(route_id);

// Certain systems can block the creation of new windows. If we didn't succeed
Expand All @@ -124,8 +124,7 @@ TabContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) {
return new_contents;
}

RenderWidgetHostView* RenderViewHostDelegateViewHelper::GetCreatedWidget(
int route_id) {
RenderWidgetHostView* TabContentsViewHelper::GetCreatedWidget(int route_id) {
PendingWidgetViews::iterator iter = pending_widget_views_.find(route_id);
if (iter == pending_widget_views_.end()) {
DCHECK(false);
Expand All @@ -144,7 +143,7 @@ RenderWidgetHostView* RenderViewHostDelegateViewHelper::GetCreatedWidget(
return widget_host_view;
}

TabContents* RenderViewHostDelegateViewHelper::ShowCreatedWindow(
TabContents* TabContentsViewHelper::ShowCreatedWindow(
WebContents* web_contents,
int route_id,
WindowOpenDisposition disposition,
Expand All @@ -160,7 +159,7 @@ TabContents* RenderViewHostDelegateViewHelper::ShowCreatedWindow(
return contents;
}

RenderWidgetHostView* RenderViewHostDelegateViewHelper::ShowCreatedWidget(
RenderWidgetHostView* TabContentsViewHelper::ShowCreatedWidget(
WebContents* web_contents,
int route_id,
bool is_fullscreen,
Expand Down
Loading

0 comments on commit d976c35

Please sign in to comment.