summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 19:43:09 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 19:43:09 +0000
commit1280270eea827aca9b676aced264a25a26efa36a (patch)
tree65063d97a0930022cc8bb5692810df9ab1305d7a /chrome
parent652727def58ab808755d4fe9930acdf783482596 (diff)
downloadchromium_src-1280270eea827aca9b676aced264a25a26efa36a.zip
chromium_src-1280270eea827aca9b676aced264a25a26efa36a.tar.gz
chromium_src-1280270eea827aca9b676aced264a25a26efa36a.tar.bz2
Try to cut down Browser/TabContents header dependencies.
- Forward declare printing::PrintViewManager in TabContents - tab_contents.h shouldn't depend on autocomplete_edit.h - Pull logging out of Browser through PageTransitionTypes BUG=none TEST=none Review URL: http://codereview.chromium.org/2934004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/automation/automation_provider.cc1
-rw-r--r--chrome/browser/browser.h1
-rw-r--r--chrome/browser/extensions/image_loading_tracker_unittest.cc1
-rw-r--r--chrome/browser/history/history_types.cc1
-rw-r--r--chrome/browser/history/visit_database.cc1
-rw-r--r--chrome/browser/omnibox_search_hint.cc1
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc1
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc1
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc13
-rw-r--r--chrome/browser/tab_contents/tab_contents.h14
-rw-r--r--chrome/browser/tab_contents/test_tab_contents.h1
-rw-r--r--chrome/browser/toolbar_model.cc1
-rw-r--r--chrome/common/extensions/extension.cc1
-rw-r--r--chrome/common/extensions/extension.h2
-rw-r--r--chrome/common/page_transition_types.cc14
-rw-r--r--chrome/common/page_transition_types.h11
16 files changed, 42 insertions, 23 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index cc9aecd..586a212 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -34,6 +34,7 @@
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/automation/automation_provider_observers.h"
#include "chrome/browser/automation/extension_port_container.h"
+#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/blocked_popup_container.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_storage.h"
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 08c746a..6fdf25f 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -12,7 +12,6 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
-#include "base/task.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/pref_member.h"
#include "chrome/browser/sessions/session_id.h"
diff --git a/chrome/browser/extensions/image_loading_tracker_unittest.cc b/chrome/browser/extensions/image_loading_tracker_unittest.cc
index 974ce54..7522838 100644
--- a/chrome/browser/extensions/image_loading_tracker_unittest.cc
+++ b/chrome/browser/extensions/image_loading_tracker_unittest.cc
@@ -14,6 +14,7 @@
#include "chrome/common/notification_type.h"
#include "gfx/size.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkBitmap.h"
class ImageLoadingTrackerTest : public testing::Test,
public ImageLoadingTracker::Observer {
diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc
index aadd0af..50395aa 100644
--- a/chrome/browser/history/history_types.cc
+++ b/chrome/browser/history/history_types.cc
@@ -6,6 +6,7 @@
#include <limits>
+#include "base/logging.h"
#include "base/stl_util-inl.h"
using base::Time;
diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc
index f19cd2d..80fa8c8 100644
--- a/chrome/browser/history/visit_database.cc
+++ b/chrome/browser/history/visit_database.cc
@@ -11,6 +11,7 @@
#include "app/sql/connection.h"
#include "app/sql/statement.h"
+#include "base/logging.h"
#include "chrome/browser/history/url_database.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/common/url_constants.h"
diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc
index 9adf9b3..28db8a9 100644
--- a/chrome/browser/omnibox_search_hint.cc
+++ b/chrome/browser/omnibox_search_hint.cc
@@ -9,6 +9,7 @@
#include "app/resource_bundle.h"
#include "base/command_line.h"
#include "base/task.h"
+#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc
index c1d15599..e1953d1 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -10,6 +10,7 @@
#include "chrome/common/dom_storage_common.h"
#include "chrome/common/render_messages.h"
#include "gfx/rect.h"
+#include "webkit/glue/webpreferences.h"
using webkit_glue::PasswordForm;
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 06b0b46..0ac2764 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -15,6 +15,7 @@
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
+#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/debugger/devtools_manager.h"
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index fa17e79..f0dd1d5 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -53,6 +53,7 @@
#include "chrome/browser/platform_util.h"
#include "chrome/browser/plugin_installer.h"
#include "chrome/browser/pref_service.h"
+#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
@@ -77,6 +78,9 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_resource.h"
+#include "chrome/common/extensions/url_pattern.h"
+#include "chrome/common/navigation_types.h"
+#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
@@ -248,7 +252,8 @@ TabContents::TabContents(Profile* profile,
ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)),
property_bag_(),
registrar_(),
- ALLOW_THIS_IN_INITIALIZER_LIST(printing_(*this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(printing_(
+ new printing::PrintViewManager(*this))),
save_package_(),
autocomplete_history_manager_(),
autofill_manager_(),
@@ -827,7 +832,7 @@ bool TabContents::NavigateToPendingEntry(
void TabContents::Stop() {
render_manager_.Stop();
- printing_.Stop();
+ printing_->Stop();
}
void TabContents::DisassociateFromPopupCount() {
@@ -2143,7 +2148,7 @@ RenderViewHostDelegate::Save* TabContents::GetSaveDelegate() {
}
RenderViewHostDelegate::Printing* TabContents::GetPrintingDelegate() {
- return &printing_;
+ return printing_.get();
}
RenderViewHostDelegate::FavIcon* TabContents::GetFavIconDelegate() {
@@ -2237,7 +2242,7 @@ void TabContents::RenderViewReady(RenderViewHost* rvh) {
void TabContents::RenderViewGone(RenderViewHost* rvh) {
// Ask the print preview if this renderer was valuable.
- if (!printing_.OnRenderViewGone(rvh))
+ if (!printing_->OnRenderViewGone(rvh))
return;
if (rvh != render_view_host()) {
// The pending page's RenderViewHost is gone.
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index d2263ec..f636734 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -16,7 +16,6 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/download/save_package.h"
@@ -26,7 +25,6 @@
#include "chrome/browser/find_notification_details.h"
#include "chrome/browser/jsmessage_box_client.h"
#include "chrome/browser/password_manager/password_manager.h"
-#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
#include "chrome/browser/tab_contents/constrained_window.h"
@@ -37,9 +35,6 @@
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/browser/tab_contents/render_view_host_manager.h"
#include "chrome/browser/tab_contents/tab_specific_content_settings.h"
-#include "chrome/common/extensions/url_pattern.h"
-#include "chrome/common/navigation_types.h"
-#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/property_bag.h"
#include "chrome/common/renderer_preferences.h"
@@ -49,7 +44,6 @@
#include "net/base/load_states.h"
#include "webkit/glue/dom_operations.h"
#include "webkit/glue/password_form.h"
-#include "webkit/glue/webpreferences.h"
namespace gfx {
class Rect;
@@ -64,6 +58,9 @@ namespace base {
class WaitableEvent;
}
+namespace printing {
+class PrintViewManager;
+}
namespace IPC {
class Message;
@@ -88,10 +85,13 @@ class TabContents;
class TabContentsDelegate;
class TabContentsFactory;
class TabContentsView;
+class URLPattern;
+class URLRequestContextGetter;
struct ThumbnailScore;
struct ViewHostMsg_DidPrintPage_Params;
struct ViewHostMsg_FrameNavigate_Params;
struct ViewHostMsg_RunFileChooser_Params;
+struct WebPreferences;
// Describes what goes in the main content area of a tab. TabContents is
// the only type of TabContents, and these should be merged together.
@@ -1054,7 +1054,7 @@ class TabContents : public PageNavigator,
NotificationRegistrar registrar_;
// Handles print preview and print job for this contents.
- printing::PrintViewManager printing_;
+ scoped_ptr<printing::PrintViewManager> printing_;
// SavePackage, lazily created.
scoped_refptr<SavePackage> save_package_;
diff --git a/chrome/browser/tab_contents/test_tab_contents.h b/chrome/browser/tab_contents/test_tab_contents.h
index aebae87..698ef04 100644
--- a/chrome/browser/tab_contents/test_tab_contents.h
+++ b/chrome/browser/tab_contents/test_tab_contents.h
@@ -8,6 +8,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_registrar.h"
+#include "webkit/glue/webpreferences.h"
class RenderViewHostFactory;
class TestRenderViewHost;
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc
index c20f487..b7a42ed 100644
--- a/chrome/browser/toolbar_model.cc
+++ b/chrome/browser/toolbar_model.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/toolbar_model.h"
#include "app/l10n_util.h"
+#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/cert_store.h"
#include "chrome/browser/pref_service.h"
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index a164ea4..33a3b03 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -33,6 +33,7 @@
#include "chrome/common/url_constants.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/image_decoder.h"
#if defined(OS_WIN)
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 5dc807f..fe7ac77 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -20,10 +20,10 @@
#include "gfx/size.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
-#include "third_party/skia/include/core/SkBitmap.h"
class ExtensionAction;
class ExtensionResource;
+class SkBitmap;
// Represents a Chrome extension.
class Extension {
diff --git a/chrome/common/page_transition_types.cc b/chrome/common/page_transition_types.cc
index 9fb49cd..bf686f9 100644
--- a/chrome/common/page_transition_types.cc
+++ b/chrome/common/page_transition_types.cc
@@ -4,6 +4,20 @@
#include "chrome/common/page_transition_types.h"
+#include "base/logging.h"
+
+// static
+PageTransition::Type PageTransition::FromInt(int32 type) {
+ if (!ValidType(type)) {
+ NOTREACHED() << "Invalid transition type " << type;
+
+ // Return a safe default so we don't have corrupt data in release mode.
+ return LINK;
+ }
+ return static_cast<Type>(type);
+}
+
+// static
const char* PageTransition::CoreTransitionString(Type type) {
switch (type & PageTransition::CORE_MASK) {
case 0: return "link";
diff --git a/chrome/common/page_transition_types.h b/chrome/common/page_transition_types.h
index bb46006..592fc29 100644
--- a/chrome/common/page_transition_types.h
+++ b/chrome/common/page_transition_types.h
@@ -6,7 +6,6 @@
#define CHROME_COMMON_PAGE_TRANSITION_TYPES_H__
#include "base/basictypes.h"
-#include "base/logging.h"
// This class is for scoping only.
class PageTransition {
@@ -131,15 +130,7 @@ class PageTransition {
return (t <= LAST_CORE);
}
- static Type FromInt(int32 type) {
- if (!ValidType(type)) {
- NOTREACHED() << "Invalid transition type " << type;
-
- // Return a safe default so we don't have corrupt data in release mode.
- return LINK;
- }
- return static_cast<Type>(type);
- }
+ static Type FromInt(int32 type);
// Returns true if the given transition is a top-level frame transition, or
// false if the transition was for a subframe.