summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/back_forward_menu_model_unittest.cc8
-rw-r--r--chrome/browser/browser.scons1
-rw-r--r--chrome/browser/tab_contents/tab_contents_factory.cc29
-rw-r--r--chrome/chrome.xcodeproj/project.pbxproj2
-rw-r--r--chrome/common/temp_scaffolding_stubs.cc21
-rw-r--r--chrome/common/temp_scaffolding_stubs.h8
-rw-r--r--chrome/test/unit/unit_tests.scons1
7 files changed, 35 insertions, 35 deletions
diff --git a/chrome/browser/back_forward_menu_model_unittest.cc b/chrome/browser/back_forward_menu_model_unittest.cc
index 0765ea8..0e642b5 100644
--- a/chrome/browser/back_forward_menu_model_unittest.cc
+++ b/chrome/browser/back_forward_menu_model_unittest.cc
@@ -10,10 +10,16 @@
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_WIN)
+// TODO(port): port this header.
+#include "chrome/browser/tab_contents/tab_contents.h"
+#elif defined(OS_POSIX)
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
+
const TabContentsType kHTTPTabContentsType =
static_cast<TabContentsType>(TAB_CONTENTS_NUM_TYPES + 1);
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons
index 477a16e..eedc096 100644
--- a/chrome/browser/browser.scons
+++ b/chrome/browser/browser.scons
@@ -736,7 +736,6 @@ if not env.Bit('windows'):
'tab_contents/native_ui_contents.cc',
'tab_contents/render_view_context_menu.cc',
'tab_contents/tab_contents.cc',
- 'tab_contents/tab_contents_factory.cc',
'tab_contents/view_source_contents.cc',
'tab_contents/web_drag_source.cc',
'tab_contents/web_drop_target.cc',
diff --git a/chrome/browser/tab_contents/tab_contents_factory.cc b/chrome/browser/tab_contents/tab_contents_factory.cc
index 18f3569..e6aa1a2 100644
--- a/chrome/browser/tab_contents/tab_contents_factory.cc
+++ b/chrome/browser/tab_contents/tab_contents_factory.cc
@@ -6,18 +6,24 @@
#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/dom_ui/dom_ui_contents.h"
-#include "chrome/browser/dom_ui/html_dialog_contents.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/debugger/debugger_contents.h"
-#include "chrome/browser/tab_contents/native_ui_contents.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_factory.h"
#include "chrome/browser/tab_contents/view_source_contents.h"
#include "chrome/browser/tab_contents/web_contents.h"
#include "net/base/net_util.h"
+#if defined(OS_WIN)
+// TODO(port): port these headers to posix.
+#include "chrome/browser/dom_ui/html_dialog_contents.h"
+#include "chrome/browser/tab_contents/native_ui_contents.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#elif defined(OS_POSIX)
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
+
typedef std::map<TabContentsType, TabContentsFactory*> TabContentsFactoryMap;
static TabContentsFactoryMap* g_extra_types; // Only allocated if needed.
@@ -33,16 +39,19 @@ TabContentsType TabContentsFactory::NextUnusedType() {
return static_cast<TabContentsType>(type + 1);
}
-/*static*/
+// static
TabContents* TabContents::CreateWithType(TabContentsType type,
Profile* profile,
SiteInstance* instance) {
- TabContents* contents;
+ TabContents* contents = NULL;
switch (type) {
case TAB_CONTENTS_WEB:
contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL);
break;
+// TODO(port): remove this platform define, either by porting the tab contents
+// types or removing them completely.
+#if defined(OS_WIN)
case TAB_CONTENTS_NEW_TAB_UI:
contents = new NewTabUIContents(profile, instance, NULL);
break;
@@ -64,6 +73,7 @@ TabContents* TabContents::CreateWithType(TabContentsType type,
case TAB_CONTENTS_DOM_UI:
contents = new DOMUIContents(profile, instance, NULL);
break;
+#endif // defined(OS_WIN)
default:
if (g_extra_types) {
TabContentsFactoryMap::const_iterator it = g_extra_types->find(type);
@@ -82,7 +92,7 @@ TabContents* TabContents::CreateWithType(TabContentsType type,
return contents;
}
-/*static*/
+// static
TabContentsType TabContents::TypeForURL(GURL* url) {
DCHECK(url);
if (g_extra_types) {
@@ -93,6 +103,8 @@ TabContentsType TabContents::TypeForURL(GURL* url) {
}
}
+// TODO(port): port the rest of this function.
+#if defined(OS_WIN)
// Try to handle as a browser URL. If successful, |url| will end up
// containing the real url being loaded (browser url's are just an alias).
TabContentsType type(TAB_CONTENTS_UNKNOWN_TYPE);
@@ -116,12 +128,15 @@ TabContentsType TabContents::TypeForURL(GURL* url) {
*url = GURL(url->path());
return TAB_CONTENTS_VIEW_SOURCE;
}
+#elif defined(OS_POSIX)
+ NOTIMPLEMENTED();
+#endif
// NOTE: Even the empty string can be loaded by a WebContents.
return TAB_CONTENTS_WEB;
}
-/*static*/
+// static
TabContentsFactory* TabContents::RegisterFactory(TabContentsType type,
TabContentsFactory* factory) {
if (!g_extra_types)
diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj
index e638c8b..e0112a40 100644
--- a/chrome/chrome.xcodeproj/project.pbxproj
+++ b/chrome/chrome.xcodeproj/project.pbxproj
@@ -344,6 +344,7 @@
B562E2F80F05843C00FB1A4F /* property_bag.cc in Sources */ = {isa = PBXBuildFile; fileRef = B562E2F60F05843C00FB1A4F /* property_bag.cc */; };
B562E2FC0F05845100FB1A4F /* property_bag_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B562E2F40F05843C00FB1A4F /* property_bag_unittest.cc */; };
B56E281B0F057F2800447108 /* message_router.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBD10E9D4C9F009A6919 /* message_router.cc */; };
+ B57F3A38042C46748C19E75B /* tab_contents_factory.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6CCB9E70F1EC32700106F0D /* tab_contents_factory.cc */; };
B58331850F40FE4E00FABC29 /* ipc_send_fds_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B58331690F40FC1F00FABC29 /* ipc_send_fds_test.cc */; };
B5D030F00F3A3C43001238AB /* renderer_main_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5D030EF0F3A3C43001238AB /* renderer_main_unittest.cc */; };
B5D031270F3A4009001238AB /* ipc_sync_channel_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBB80E9D4C9F009A6919 /* ipc_sync_channel_unittest.cc */; };
@@ -5503,6 +5504,7 @@
E45075EE0F150ABA003BE099 /* sync_resource_handler.cc in Sources */,
E455DDBA0F3227A600DD4383 /* tab_cell.mm in Sources */,
E455DCF10F320CFE00DD4383 /* tab_contents_controller.mm in Sources */,
+ B57F3A38042C46748C19E75B /* tab_contents_factory.cc in Sources */,
1C284EB767D0E3D302AC675C /* tab_restore_service.cc in Sources */,
E455DCF00F320CF700DD4383 /* tab_strip_controller.mm in Sources */,
E46C53A40F2F660900B393B8 /* tab_strip_model.cc in Sources */,
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc
index 25520df..bd4dfe2 100644
--- a/chrome/common/temp_scaffolding_stubs.cc
+++ b/chrome/common/temp_scaffolding_stubs.cc
@@ -202,27 +202,6 @@ void UninstallJankometer() {
//--------------------------------------------------------------------------
-TabContents* TabContents::CreateWithType(TabContentsType type,
- Profile* profile,
- SiteInstance* instance) {
- TabContents* contents;
-
- switch (type) {
- case TAB_CONTENTS_WEB:
- contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE,
- NULL);
- break;
- default:
- NOTREACHED() << "Don't know how to create tab contents of type " << type;
- contents = NULL;
- }
-
- if (contents)
- contents->CreateView();
-
- return contents;
-}
-
void TabContents::SetupController(Profile* profile) {
DCHECK(!controller_);
controller_ = new NavigationController(this, profile);
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index ac2ac55..79854333 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -77,6 +77,7 @@ class SiteInstance;
class SpellChecker;
class TabContents;
class TabContentsDelegate;
+class TabContentsFactory;
class TabNavigation;
struct ThumbnailScore;
class Task;
@@ -408,10 +409,7 @@ class TabContents : public PageNavigator, public NotificationObserver {
return false;
}
virtual void RestoreFocus() { NOTIMPLEMENTED(); }
- static TabContentsType TypeForURL(GURL* url) {
- NOTIMPLEMENTED();
- return TAB_CONTENTS_WEB;
- }
+ static TabContentsType TypeForURL(GURL* url);
static TabContents* CreateWithType(TabContentsType type,
Profile* profile,
SiteInstance* instance);
@@ -459,6 +457,8 @@ class TabContents : public PageNavigator, public NotificationObserver {
}
virtual void CreateView() {}
virtual gfx::NativeView GetNativeView() const { return NULL; }
+ static TabContentsFactory* RegisterFactory(TabContentsType type,
+ TabContentsFactory* factory);
protected:
typedef std::vector<ConstrainedWindow*> ConstrainedWindowList;
ConstrainedWindowList child_windows_;
diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons
index 3779aabf..301fc24 100644
--- a/chrome/test/unit/unit_tests.scons
+++ b/chrome/test/unit/unit_tests.scons
@@ -384,7 +384,6 @@ if not env.Bit('windows'):
'$CHROME_DIR/browser/autocomplete/history_contents_provider_unittest.cc',
'$CHROME_DIR/browser/autocomplete/history_url_provider_unittest.cc',
'$CHROME_DIR/browser/autocomplete/keyword_provider_unittest.cc',
- '$CHROME_DIR/browser/back_forward_menu_model_unittest.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_context_menu_test.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_drag_data_unittest.cc',
'$CHROME_DIR/browser/bookmarks/bookmark_folder_tree_model_unittest.cc',