diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 21:47:35 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 21:47:35 +0000 |
commit | 8dad546b6804ac8ef0e57146653f5bbdbe703632 (patch) | |
tree | b4f89946c8d8175f9c5b0bcca12ac8b29743b823 | |
parent | 526d4e6440a9e9b76bd664e923b97ecca698ee7c (diff) | |
download | chromium_src-8dad546b6804ac8ef0e57146653f5bbdbe703632.zip chromium_src-8dad546b6804ac8ef0e57146653f5bbdbe703632.tar.gz chromium_src-8dad546b6804ac8ef0e57146653f5bbdbe703632.tar.bz2 |
Ensure that view_messages.h and tab_contents.h don't get included by any more code. The only remaining place is tab_contents_view_mac.mm. Instead of waiting until it moves, I've moved it to a directory with a DEPS file to allow those includes. That way we can enforce that no new files include those headers. It took a few weeks work to remove all the dependencies, and we don't want them regressing.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9178026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117962 0039d316-1c4b-4281-b951-d872f2087c98
25 files changed, 56 insertions, 45 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index add6ec0..a6ebd97 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -37,12 +37,11 @@ include_rules = [ "-content/browser/tab_contents/navigation_controller_impl.h", "-content/browser/tab_contents/navigation_entry_impl.h", "-content/browser/tab_contents/render_view_host_manager.h", + "+content/browser/tab_contents/tab_contents.h", "-content/browser/plugin_service_impl.h", "-content/browser/worker_service_impl.h", "-content/common", - # TODO(jam): remove all the exceptions. BUG=98716 - "+content/common/view_messages.h", # Other libraries. "+chrome/third_party/hunspell", diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm index a3d6b5b..52682a8 100644 --- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm +++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm @@ -12,7 +12,7 @@ #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/tab_contents/tab_contents_view_mac.h" +#include "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" #include "skia/ext/skia_utils_mac.h" #include "ui/gfx/mac/nsimage_cache.h" diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 102d6e7..30cd0a3 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -127,7 +127,7 @@ #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h" #include "content/browser/tab_contents/tab_contents_view_gtk.h" #elif defined(OS_MACOSX) -#include "chrome/browser/tab_contents/tab_contents_view_mac.h" +#include "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #endif #if defined(USE_NSS) @@ -308,14 +308,14 @@ content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts( } TabContentsView* ChromeContentBrowserClient::CreateTabContentsView( - TabContents* tab_contents) { + WebContents* web_contents) { #if defined(TOOLKIT_VIEWS) - return new TabContentsViewViews(tab_contents); + return new TabContentsViewViews(web_contents); #elif defined(TOOLKIT_USES_GTK) - return new content::TabContentsViewGtk(tab_contents, + return new content::TabContentsViewGtk(web_contents, new ChromeTabContentsViewWrapperGtk); #elif defined(OS_MACOSX) - return tab_contents_view_mac::CreateTabContentsView(tab_contents); + return tab_contents_view_mac::CreateTabContentsView(web_contents); #else #error Need to create your platform TabContentsView here. #endif diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 2eda665..0ba18fe 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -18,7 +18,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual TabContentsView* CreateTabContentsView( - TabContents* tab_contents) OVERRIDE; + content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated(RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( content::RenderProcessHost* host) OVERRIDE; diff --git a/chrome/browser/tab_contents/moving_to_content/DEPS b/chrome/browser/tab_contents/moving_to_content/DEPS new file mode 100644 index 0000000..7d0922b --- /dev/null +++ b/chrome/browser/tab_contents/moving_to_content/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "+content/browser/tab_contents/tab_contents.h", + "+content/common/view_messages.h", +] diff --git a/chrome/browser/tab_contents/moving_to_content/DO_NOT_ADD_NEW_FILES_HERE b/chrome/browser/tab_contents/moving_to_content/DO_NOT_ADD_NEW_FILES_HERE new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/chrome/browser/tab_contents/moving_to_content/DO_NOT_ADD_NEW_FILES_HERE diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.h b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h index d8082fc..a9e0eb6 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.h +++ b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h @@ -56,7 +56,8 @@ class TabContentsViewMac : public TabContentsView { // The corresponding TabContents is passed in the constructor, and manages our // lifetime. This doesn't need to be the case, but is this way currently // because that's what was easiest when they were split. - explicit TabContentsViewMac(TabContents* web_contents); + // TODO(jam): make this take a WebContents once it's created from content. + explicit TabContentsViewMac(content::WebContents* web_contents); virtual ~TabContentsViewMac(); // TabContentsView implementation -------------------------------------------- @@ -147,11 +148,14 @@ class TabContentsViewMac : public TabContentsView { #endif // __OBJC__ // Functions that may be accessed from non-Objective-C C/C++ code. -class TabContents; class TabContentsView; +namespace content { +class WebContents; +} + namespace tab_contents_view_mac { -TabContentsView* CreateTabContentsView(TabContents* tab_contents); +TabContentsView* CreateTabContentsView(content::WebContents* web_contents); } #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_VIEW_MAC_H_ diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.mm index 64312d0..d8f338f 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.mm @@ -4,7 +4,7 @@ #import <Carbon/Carbon.h> -#include "chrome/browser/tab_contents/tab_contents_view_mac.h" +#include "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #include <string> @@ -30,6 +30,7 @@ using WebKit::WebDragOperation; using WebKit::WebDragOperationsMask; +using content::WebContents; // Ensure that the WebKit::WebDragOperation enum values stay in sync with // NSDragOperation constants, since the code below static_casts between 'em. @@ -62,13 +63,13 @@ COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); @end namespace tab_contents_view_mac { -TabContentsView* CreateTabContentsView(TabContents* tab_contents) { - return new TabContentsViewMac(tab_contents); +TabContentsView* CreateTabContentsView(WebContents* web_contents) { + return new TabContentsViewMac(web_contents); } } -TabContentsViewMac::TabContentsViewMac(TabContents* tab_contents) - : tab_contents_(tab_contents), +TabContentsViewMac::TabContentsViewMac(WebContents* web_contents) + : tab_contents_(static_cast<TabContents*>(web_contents)), overlaid_view_(nil) { } diff --git a/chrome/browser/tab_contents/tab_contents_view_mac_unittest.mm b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac_unittest.mm index 260757c..233f78a 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac_unittest.mm +++ b/chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac_unittest.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "chrome/browser/tab_contents/tab_contents_view_mac.h" +#import "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #include "base/memory/scoped_nsobject.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" diff --git a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc index fc2ac3d..32c12ed 100644 --- a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc +++ b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc @@ -12,7 +12,6 @@ #include "content/browser/renderer_host/backing_store_skia.h" #include "content/browser/renderer_host/mock_render_process_host.h" #include "content/browser/renderer_host/test_render_view_host.h" -#include "content/common/view_messages.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "skia/ext/platform_canvas.h" diff --git a/chrome/browser/ui/cocoa/download/download_started_animation_mac.mm b/chrome/browser/ui/cocoa/download/download_started_animation_mac.mm index 83c37d2..22a14a8 100644 --- a/chrome/browser/ui/cocoa/download/download_started_animation_mac.mm +++ b/chrome/browser/ui/cocoa/download/download_started_animation_mac.mm @@ -11,7 +11,7 @@ #import <QuartzCore/QuartzCore.h> -#include "chrome/browser/tab_contents/tab_contents_view_mac.h" +#include "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #import "chrome/browser/ui/cocoa/animatable_image.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm index 9d8f63e..cda92a4 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm @@ -5,7 +5,7 @@ #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" #include "chrome/browser/extensions/extension_host.h" -#include "chrome/browser/tab_contents/tab_contents_view_mac.h" +#include "chrome/browser/tab_contents/moving_to_content/tab_contents_view_mac.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/tab_contents_view.h" diff --git a/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm b/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm index 667a332..6e6b321 100644 --- a/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/web_intent_bubble_controller.mm @@ -12,8 +12,8 @@ #include "chrome/browser/ui/cocoa/web_intent_picker_cocoa.h" #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/public/browser/web_contents.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm index b12fa19..03b5cdf 100644 --- a/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm +++ b/chrome/browser/ui/cocoa/web_intent_picker_cocoa.mm @@ -15,7 +15,7 @@ #include "chrome/browser/ui/intents/web_intent_picker.h" #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "content/browser/tab_contents/tab_contents.h" +#include "content/public/browser/web_contents.h" #include "skia/ext/skia_utils_mac.h" using content::WebContents; @@ -104,11 +104,11 @@ void WebIntentPickerCocoa::Close() { } WebContents* WebIntentPickerCocoa::SetInlineDisposition(const GURL& url) { - TabContents* tab_contents = new TabContents( + WebContents* web_contents = WebContents::Create( browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); - inline_disposition_tab_contents_.reset(new TabContentsWrapper(tab_contents)); + inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); inline_disposition_delegate_.reset(new InlineHtmlContentDelegate); - tab_contents->SetDelegate(inline_disposition_delegate_.get()); + web_contents->SetDelegate(inline_disposition_delegate_.get()); inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( url, diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc index bd7d674..1f5a2ea 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller2_interactive_uitest.cc @@ -20,11 +20,11 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" -#include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" +#include "content/public/browser/web_contents.h" #include "ui/gfx/screen.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index af7b36d..c22b142 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2378,8 +2378,8 @@ 'browser/tab_contents/retargeting_details.h', 'browser/tab_contents/tab_contents_ssl_helper.cc', 'browser/tab_contents/tab_contents_ssl_helper.h', - 'browser/tab_contents/tab_contents_view_mac.h', - 'browser/tab_contents/tab_contents_view_mac.mm', + 'browser/tab_contents/moving_to_content/tab_contents_view_mac.h', + 'browser/tab_contents/moving_to_content/tab_contents_view_mac.mm', 'browser/tab_contents/tab_util.cc', 'browser/tab_contents/tab_util.h', 'browser/tab_contents/thumbnail_generator.cc', diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index 0476f7d..31cd447 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -29,7 +29,7 @@ BrowserMainParts* MockContentBrowserClient::CreateBrowserMainParts( } TabContentsView* MockContentBrowserClient::CreateTabContentsView( - TabContents* tab_contents) { + WebContents* web_contents) { return new TestTabContentsView; } diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index 6e47710..ef52b51 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -24,7 +24,7 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual TabContentsView* CreateTabContentsView( - TabContents* tab_contents) OVERRIDE; + WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( diff --git a/content/browser/tab_contents/tab_contents_view_gtk.cc b/content/browser/tab_contents/tab_contents_view_gtk.cc index ed87863..36681b2 100644 --- a/content/browser/tab_contents/tab_contents_view_gtk.cc +++ b/content/browser/tab_contents/tab_contents_view_gtk.cc @@ -78,9 +78,9 @@ gboolean OnMouseScroll(GtkWidget* widget, GdkEventScroll* event, namespace content { TabContentsViewGtk::TabContentsViewGtk( - TabContents* tab_contents, + content::WebContents* web_contents, content::TabContentsViewWrapperGtk* view_wrapper) - : tab_contents_(tab_contents), + : tab_contents_(static_cast<TabContents*>(web_contents)), expanded_(gtk_expanded_container_new()), view_wrapper_(view_wrapper), overlaid_view_(NULL) { @@ -91,7 +91,7 @@ TabContentsViewGtk::TabContentsViewGtk( G_CALLBACK(OnChildSizeRequestThunk), this); gtk_widget_show(expanded_.get()); - drag_source_.reset(new content::WebDragSourceGtk(tab_contents)); + drag_source_.reset(new content::WebDragSourceGtk(web_contents)); if (view_wrapper_.get()) view_wrapper_->WrapView(this); diff --git a/content/browser/tab_contents/tab_contents_view_gtk.h b/content/browser/tab_contents/tab_contents_view_gtk.h index bafaa8d..ccd3c7d 100644 --- a/content/browser/tab_contents/tab_contents_view_gtk.h +++ b/content/browser/tab_contents/tab_contents_view_gtk.h @@ -32,7 +32,8 @@ class CONTENT_EXPORT TabContentsViewGtk : public TabContentsView { // because that's what was easiest when they were split. We optionally take // |wrapper| which creates an intermediary widget layer for features from the // embedding layer that live with the TabContentsView. - explicit TabContentsViewGtk(TabContents* tab_contents, + // TODO(jam): make this take a WebContents once it's created from content. + explicit TabContentsViewGtk(content::WebContents* web_contents, TabContentsViewWrapperGtk* wrapper); virtual ~TabContentsViewGtk(); diff --git a/content/browser/tab_contents/tab_contents_view_win.cc b/content/browser/tab_contents/tab_contents_view_win.cc index 3bd9d5c..c70ea75 100644 --- a/content/browser/tab_contents/tab_contents_view_win.cc +++ b/content/browser/tab_contents/tab_contents_view_win.cc @@ -11,6 +11,8 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/public/browser/web_contents_delegate.h" +using content::WebContents; + namespace { // We need to have a parent window for the compositing code to work correctly. @@ -46,9 +48,9 @@ class TempParent : public ui::WindowImpl { } // namespace namespace -TabContentsViewWin::TabContentsViewWin(TabContents* tab_contents) +TabContentsViewWin::TabContentsViewWin(WebContents* web_contents) : parent_(NULL), - tab_contents_(tab_contents), + tab_contents_(static_cast<TabContents*>(web_contents)), view_(NULL) { } diff --git a/content/browser/tab_contents/tab_contents_view_win.h b/content/browser/tab_contents/tab_contents_view_win.h index 582ce48..ce994b8 100644 --- a/content/browser/tab_contents/tab_contents_view_win.h +++ b/content/browser/tab_contents/tab_contents_view_win.h @@ -16,7 +16,8 @@ class RenderWidgetHostViewWin; class TabContentsViewWin : public TabContentsView, public ui::WindowImpl { public: - explicit TabContentsViewWin(TabContents* tab_contents); + // TODO(jam): make this take a WebContents once it's created from content. + explicit TabContentsViewWin(content::WebContents* web_contents); virtual ~TabContentsViewWin(); void SetParent(HWND parent); diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 9a9fda1..b806a1d 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -27,7 +27,6 @@ class SiteInstance; class SSLCertErrorHandler; class SSLClientAuthHandler; class SkBitmap; -class TabContents; class TabContentsView; class WorkerProcessHost; struct WebPreferences; @@ -35,9 +34,10 @@ struct WebPreferences; namespace content { class AccessTokenStore; class BrowserMainParts; +class RenderProcessHost; +class WebContents; struct MainFunctionParams; struct ShowDesktopNotificationHostMsgParams; -class RenderProcessHost; } namespace crypto { @@ -85,7 +85,7 @@ class ContentBrowserClient { virtual BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) = 0; - virtual TabContentsView* CreateTabContentsView(TabContents* tab_contents) = 0; + virtual TabContentsView* CreateTabContentsView(WebContents* web_contents) = 0; // Notifies that a new RenderHostView has been created. virtual void RenderViewHostCreated(RenderViewHost* render_view_host) = 0; diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 0f2131a..7a0dbfb 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -35,11 +35,11 @@ BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( } TabContentsView* ShellContentBrowserClient::CreateTabContentsView( - TabContents* tab_contents) { + WebContents* web_contents) { #if defined(OS_WIN) - return new TabContentsViewWin(tab_contents); + return new TabContentsViewWin(web_contents); #elif defined(OS_LINUX) - return new TabContentsViewGtk(tab_contents, NULL); + return new TabContentsViewGtk(web_contents, NULL); #else return NULL; #endif diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 98fa144..347841a 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -28,7 +28,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { virtual BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; virtual TabContentsView* CreateTabContentsView( - TabContents* tab_contents) OVERRIDE; + content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( RenderViewHost* render_view_host) OVERRIDE; virtual void RenderProcessHostCreated( |