summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 19:41:20 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 19:41:20 +0000
commitd6a3c776fb31318970dc635529a482c5790beeb4 (patch)
tree277d3d060e62d3048d3cdb8525e361f635fae892
parent8b7064cefb6a2aa9b1577a1c86763d09520238fa (diff)
downloadchromium_src-d6a3c776fb31318970dc635529a482c5790beeb4.zip
chromium_src-d6a3c776fb31318970dc635529a482c5790beeb4.tar.gz
chromium_src-d6a3c776fb31318970dc635529a482c5790beeb4.tar.bz2
remove scaffolding mock of TabStripModel and replace it with the real deal. Remove some more ifdefs in Browser to implement delegate overrides.
Review URL: http://codereview.chromium.org/19019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8740 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc22
-rw-r--r--chrome/browser/browser.h14
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc13
-rw-r--r--chrome/browser/tabs/tab_strip_model_order_controller.cc6
-rw-r--r--chrome/chrome.xcodeproj/project.pbxproj26
-rw-r--r--chrome/common/temp_scaffolding_stubs.cpp18
-rw-r--r--chrome/common/temp_scaffolding_stubs.h48
7 files changed, 90 insertions, 57 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 69fddec..7cb862c 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -302,9 +302,9 @@ void Browser::OpenURLOffTheRecord(Profile* profile, const GURL& url) {
browser->window()->Show();
}
-#if defined(OS_WIN)
// static
void Browser::OpenWebApplication(Profile* profile, WebApp* app) {
+#if defined(OS_WIN)
const std::wstring& app_name =
app->name().empty() ? ComputeApplicationNameFromURL(app->url()) :
app->name();
@@ -313,8 +313,8 @@ void Browser::OpenWebApplication(Profile* profile, WebApp* app) {
Browser* browser = Browser::CreateForApp(app_name, profile);
browser->AddWebApplicationTab(profile, app, false);
browser->window()->Show();
-}
#endif
+}
///////////////////////////////////////////////////////////////////////////////
// Browser, State Storage and Retrieval for UI:
@@ -503,6 +503,8 @@ TabContents* Browser::AddWebApplicationTab(Profile* profile,
return contents;
}
+#endif
+
TabContents* Browser::AddTabWithNavigationController(
NavigationController* ctrl, PageTransition::Type type) {
TabContents* tc = ctrl->active_contents();
@@ -510,6 +512,8 @@ TabContents* Browser::AddTabWithNavigationController(
return tc;
}
+#if defined(OS_WIN)
+
NavigationController* Browser::AddRestoredTab(
const std::vector<TabNavigation>& navigations,
int tab_index,
@@ -1231,8 +1235,6 @@ void Browser::ExecuteCommand(int id) {
}
}
-#if defined(OS_WIN)
-
///////////////////////////////////////////////////////////////////////////////
// Browser, TabStripModelDelegate implementation:
@@ -1261,14 +1263,17 @@ void Browser::CreateNewStripWithContents(TabContents* detached_contents,
browser->LoadingStateChanged(detached_contents);
browser->window()->Show();
+#if defined(OS_WIN) || defined(OS_LINUX)
// When we detach a tab we need to make sure any associated Find window moves
// along with it to its new home (basically we just make new_window the
// parent of the Find window).
// TODO(brettw) this could probably be improved, see
// WebContentsView::ReparentFindWindow for more.
+ // TODO(port): remove the view dependency from this.
WebContents* web_contents = detached_contents->AsWebContents();
if (web_contents)
web_contents->view()->ReparentFindWindow(browser);
+#endif
}
int Browser::GetDragActions() const {
@@ -1302,8 +1307,6 @@ TabContents* Browser::CreateTabContentsForURL(
return contents;
}
-#endif // OS_WIN
-
bool Browser::CanDuplicateContentsAt(int index) {
TabContents* contents = GetTabContentsAt(index);
DCHECK(contents);
@@ -1312,8 +1315,6 @@ bool Browser::CanDuplicateContentsAt(int index) {
return nc ? (nc->active_contents() && nc->GetLastCommittedEntry()) : false;
}
-#if defined(OS_WIN)
-
void Browser::DuplicateContentsAt(int index) {
TabContents* contents = GetTabContentsAt(index);
TabContents* new_contents = NULL;
@@ -1363,11 +1364,14 @@ void Browser::DuplicateContentsAt(int index) {
}
void Browser::CloseFrameAfterDragSession() {
+#if defined(OS_WIN)
// This is scheduled to run after we return to the message loop because
// otherwise the frame will think the drag session is still active and ignore
// the request.
+ // TODO(port): figure out what is required here in a cross-platform world
MessageLoop::current()->PostTask(FROM_HERE,
method_factory_.NewRunnableMethod(&Browser::CloseFrame));
+#endif
}
void Browser::CreateHistoricalTab(TabContents* contents) {
@@ -1404,6 +1408,8 @@ bool Browser::RunUnloadListenerBeforeClosing(TabContents* contents) {
return false;
}
+#if defined(OS_WIN)
+
///////////////////////////////////////////////////////////////////////////////
// Browser, TabStripModelObserver implementation:
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 1e1875b..db9f326 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -18,6 +18,7 @@
#include "chrome/browser/browser_window.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/sessions/session_id.h"
+#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_member.h"
#include "base/gfx/rect.h"
@@ -27,7 +28,6 @@
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
-#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/toolbar_model.h"
#endif
@@ -122,10 +122,8 @@ class Browser : public TabStripModelDelegate,
// |profile|, that session is re-used.
static void OpenURLOffTheRecord(Profile* profile, const GURL& url);
-#if defined(OS_WIN)
// Opens the a new application window for the specified WebApp.
static void OpenWebApplication(Profile* profile, WebApp* app);
-#endif
// State Storage and Retrieval for UI ///////////////////////////////////////
@@ -192,7 +190,6 @@ class Browser : public TabStripModelDelegate,
PageTransition::Type transition, bool foreground,
SiteInstance* instance);
-#if defined(OS_WIN)
// Add a new application tab for the specified URL. If lazy is true, the tab
// won't be selected. Further, the initial web page load will only take place
// when the tab is first selected.
@@ -205,6 +202,7 @@ class Browser : public TabStripModelDelegate,
TabContents* AddTabWithNavigationController(NavigationController* ctrl,
PageTransition::Type type);
+#if defined(OS_WIN)
// Add a tab with its session history restored from the SessionRestore
// system. If select is true, the tab is selected. Returns the created
// NavigationController. |tab_index| gives the index to insert the tab at.
@@ -330,7 +328,6 @@ class Browser : public TabStripModelDelegate,
// Overridden from CommandUpdater::CommandUpdaterDelegate:
virtual void ExecuteCommand(int id);
-#if defined(OS_WIN)
// Overridden from TabStripModelDelegate:
virtual GURL GetBlankTabURL() const;
virtual void CreateNewStripWithContents(TabContents* detached_contents,
@@ -346,14 +343,13 @@ class Browser : public TabStripModelDelegate,
PageTransition::Type transition,
bool defer_load,
SiteInstance* instance) const;
-#endif
virtual bool CanDuplicateContentsAt(int index);
-#if defined(OS_WIN)
virtual void DuplicateContentsAt(int index);
virtual void CloseFrameAfterDragSession();
virtual void CreateHistoricalTab(TabContents* contents);
virtual bool RunUnloadListenerBeforeClosing(TabContents* contents);
+#if defined(OS_WIN)
// Overridden from TabStripModelObserver:
virtual void TabInsertedAt(TabContents* contents,
int index,
@@ -383,7 +379,9 @@ class Browser : public TabStripModelDelegate,
const gfx::Rect& initial_pos,
bool user_gesture);
virtual void ActivateContents(TabContents* contents);
+#endif
virtual void LoadingStateChanged(TabContents* source);
+#if defined(OS_WIN)
virtual void CloseContents(TabContents* source);
virtual void MoveContents(TabContents* source, const gfx::Rect& pos);
virtual bool IsPopup(TabContents* source);
@@ -455,9 +453,9 @@ class Browser : public TabStripModelDelegate,
// TODO(beng): remove, and provide AutomationProvider a better way to access
// the LocationBarView's edit.
friend class AutomationProvider;
+#endif // OS_WIN
// Getters for the location bar and go button.
-#endif // OS_WIN
LocationBarView* GetLocationBarView() const;
GoButton* GetGoButton();
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index c6b47e3..5150938 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -6,10 +6,16 @@
#include <algorithm>
-#include "chrome/browser/metrics/user_metrics.h"
+#if defined(OS_WIN)
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#elif defined(OS_MACOSX) || (OS_LINUX)
+// TODO(port): remove this when the mocks of the above classes are removed
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
+
+#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
#include "chrome/common/stl_util-inl.h"
@@ -18,8 +24,8 @@
TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
: delegate_(delegate),
- profile_(profile),
selected_index_(kNoTab),
+ profile_(profile),
closing_all_(false),
order_controller_(NULL) {
DCHECK(delegate_);
@@ -328,7 +334,7 @@ void TabStripModel::AddTabContents(TabContents* contents,
if (index < 0)
index = count();
}
- TabContents* last_selected_contents = GetSelectedTabContents();
+
// Tabs opened from links inherit the "group" attribute of the Tab from which
// they were opened. This means when they're closed, that Tab will be
// selected again.
@@ -531,7 +537,6 @@ void TabStripModel::ChangeSelectedContentsFrom(
if (old_contents == new_contents)
return;
TabContents* last_selected_contents = old_contents;
- int from_index = selected_index_;
selected_index_ = to_index;
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc
index 1a1d416..8052636 100644
--- a/chrome/browser/tabs/tab_strip_model_order_controller.cc
+++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc
@@ -4,8 +4,12 @@
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
+#if defined(OS_WIN)
#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/browser/tabs/tab_strip_model.h"
+#elif defined(OS_MACOSX) || (OS_LINUX)
+// TODO(port): remove this when the mock of TabContents is removed
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
#include "chrome/common/pref_names.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj
index 4f14b07..2a9f725 100644
--- a/chrome/chrome.xcodeproj/project.pbxproj
+++ b/chrome/chrome.xcodeproj/project.pbxproj
@@ -349,6 +349,8 @@
E46C51240F2A14A300B393B8 /* go.pdf in Resources */ = {isa = PBXBuildFile; fileRef = E46C51230F2A14A300B393B8 /* go.pdf */; };
E46C51640F2A1DAB00B393B8 /* toolbar_view.mm in Sources */ = {isa = PBXBuildFile; fileRef = E46C51630F2A1DAB00B393B8 /* toolbar_view.mm */; };
E46C519A0F2A20CC00B393B8 /* toolbar_button_cell.mm in Sources */ = {isa = PBXBuildFile; fileRef = E46C51990F2A20CC00B393B8 /* toolbar_button_cell.mm */; };
+ E46C53A40F2F660900B393B8 /* tab_strip_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = E46C53A20F2F660900B393B8 /* tab_strip_model.cc */; };
+ E46C53AA0F2F662F00B393B8 /* tab_strip_model_order_controller.cc in Sources */ = {isa = PBXBuildFile; fileRef = E46C53A90F2F662F00B393B8 /* tab_strip_model_order_controller.cc */; };
E48B66A80F26257E002E47EC /* libnet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7B004E0E9D5464009A6919 /* libnet.a */; };
E48B67320F2625B8002E47EC /* libgoogleurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFF6E0E9D540F009A6919 /* libgoogleurl.a */; };
E48B67CB0F262607002E47EC /* libmodp_b64.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7B005D0E9D54AA009A6919 /* libmodp_b64.a */; };
@@ -1767,8 +1769,6 @@
B6CCB9D80F1EC32700106F0D /* navigation_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = navigation_controller.h; path = tab_contents/navigation_controller.h; sourceTree = "<group>"; };
B6CCB9D90F1EC32700106F0D /* navigation_entry.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = navigation_entry.cc; path = tab_contents/navigation_entry.cc; sourceTree = "<group>"; };
B6CCB9DA0F1EC32700106F0D /* navigation_entry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = navigation_entry.h; path = tab_contents/navigation_entry.h; sourceTree = "<group>"; };
- B6CCB9DB0F1EC32700106F0D /* network_status_view.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = network_status_view.cc; path = tab_contents/network_status_view.cc; sourceTree = "<group>"; };
- B6CCB9DC0F1EC32700106F0D /* network_status_view.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = network_status_view.h; path = tab_contents/network_status_view.h; sourceTree = "<group>"; };
B6CCB9DD0F1EC32700106F0D /* page_navigator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = page_navigator.h; path = tab_contents/page_navigator.h; sourceTree = "<group>"; };
B6CCB9DE0F1EC32700106F0D /* provisional_load_details.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = provisional_load_details.cc; path = tab_contents/provisional_load_details.cc; sourceTree = "<group>"; };
B6CCB9DF0F1EC32700106F0D /* provisional_load_details.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = provisional_load_details.h; path = tab_contents/provisional_load_details.h; sourceTree = "<group>"; };
@@ -1917,6 +1917,11 @@
E46C51630F2A1DAB00B393B8 /* toolbar_view.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = toolbar_view.mm; path = cocoa/toolbar_view.mm; sourceTree = "<group>"; };
E46C51980F2A20CC00B393B8 /* toolbar_button_cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = toolbar_button_cell.h; path = cocoa/toolbar_button_cell.h; sourceTree = "<group>"; };
E46C51990F2A20CC00B393B8 /* toolbar_button_cell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = toolbar_button_cell.mm; path = cocoa/toolbar_button_cell.mm; sourceTree = "<group>"; };
+ E46C53A20F2F660900B393B8 /* tab_strip_model.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tab_strip_model.cc; path = tabs/tab_strip_model.cc; sourceTree = "<group>"; };
+ E46C53A30F2F660900B393B8 /* tab_strip_model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tab_strip_model.h; path = tabs/tab_strip_model.h; sourceTree = "<group>"; };
+ E46C53A80F2F662F00B393B8 /* tab_strip_model_order_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tab_strip_model_order_controller.h; path = tabs/tab_strip_model_order_controller.h; sourceTree = "<group>"; };
+ E46C53A90F2F662F00B393B8 /* tab_strip_model_order_controller.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tab_strip_model_order_controller.cc; path = tabs/tab_strip_model_order_controller.cc; sourceTree = "<group>"; };
+ E46C53E70F2F69AD00B393B8 /* tab_strip_model_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tab_strip_model_unittest.cc; path = tabs/tab_strip_model_unittest.cc; sourceTree = "<group>"; };
E48B684C0F2630D3002E47EC /* browser_window_factory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = browser_window_factory.mm; sourceTree = "<group>"; };
E48B68550F26330C002E47EC /* browser_window_controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = browser_window_controller.h; sourceTree = "<group>"; };
E48B68560F26330C002E47EC /* browser_window_controller.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = browser_window_controller.mm; sourceTree = "<group>"; };
@@ -2284,6 +2289,7 @@
E45075F00F150BEA003BE099 /* sessions */,
B5D16EC80F2144F700861FAC /* ssl */,
B6CCB9BA0F1EC2E100106F0D /* tab_contents */,
+ E46C538C0F2F65CA00B393B8 /* tabs */,
E450761C0F150DF9003BE099 /* webdata */,
4D7BF8240E9D4839009A6919 /* alternate_nav_url_fetcher.cc */,
4D7BF8250E9D4839009A6919 /* alternate_nav_url_fetcher.h */,
@@ -3109,8 +3115,6 @@
B6CCB9D80F1EC32700106F0D /* navigation_controller.h */,
B6CCB9D90F1EC32700106F0D /* navigation_entry.cc */,
B6CCB9DA0F1EC32700106F0D /* navigation_entry.h */,
- B6CCB9DB0F1EC32700106F0D /* network_status_view.cc */,
- B6CCB9DC0F1EC32700106F0D /* network_status_view.h */,
B6CCB9DD0F1EC32700106F0D /* page_navigator.h */,
B6CCB9DE0F1EC32700106F0D /* provisional_load_details.cc */,
B6CCB9DF0F1EC32700106F0D /* provisional_load_details.h */,
@@ -3374,6 +3378,18 @@
name = cocoa;
sourceTree = "<group>";
};
+ E46C538C0F2F65CA00B393B8 /* tabs */ = {
+ isa = PBXGroup;
+ children = (
+ E46C53A80F2F662F00B393B8 /* tab_strip_model_order_controller.h */,
+ E46C53A90F2F662F00B393B8 /* tab_strip_model_order_controller.cc */,
+ E46C53E70F2F69AD00B393B8 /* tab_strip_model_unittest.cc */,
+ E46C53A20F2F660900B393B8 /* tab_strip_model.cc */,
+ E46C53A30F2F660900B393B8 /* tab_strip_model.h */,
+ );
+ name = tabs;
+ sourceTree = "<group>";
+ };
E48FB9600EC4EA270052B72B /* automation */ = {
isa = PBXGroup;
children = (
@@ -4173,6 +4189,8 @@
F775995035B63E51251B0922 /* ssl_error_info.cc in Sources */,
E4F3245D0EE5CFDF002533CE /* starred_url_database.cc in Sources */,
E45075EE0F150ABA003BE099 /* sync_resource_handler.cc in Sources */,
+ E46C53A40F2F660900B393B8 /* tab_strip_model.cc in Sources */,
+ E46C53AA0F2F662F00B393B8 /* tab_strip_model_order_controller.cc in Sources */,
9A1EE0F9187ACE2DCB8512E1 /* template_url.cc in Sources */,
C39F08C4FFD9C2F98384F56B /* template_url_model.cc in Sources */,
B9BF55F87A4BB2FD366B6DDC /* template_url_parser.cc in Sources */,
diff --git a/chrome/common/temp_scaffolding_stubs.cpp b/chrome/common/temp_scaffolding_stubs.cpp
index 1228938..3d5037c 100644
--- a/chrome/common/temp_scaffolding_stubs.cpp
+++ b/chrome/common/temp_scaffolding_stubs.cpp
@@ -189,6 +189,10 @@ void OnShutdownStarting(ShutdownType type) { }
void OpenFirstRunDialog(Profile* profile) { }
+GURL NewTabUIURL() {
+ return GURL();
+}
+
//--------------------------------------------------------------------------
PluginService* PluginService::GetInstance() {
@@ -229,5 +233,17 @@ GURL Browser::GetHomePage() {
TabContents* Browser::AddTabWithURL(
const GURL& url, const GURL& referrer, PageTransition::Type transition,
bool foreground, SiteInstance* instance) {
- return NULL;
+ return new TabContents;
}
+
+void Browser::LoadingStateChanged(TabContents* source) {
+}
+
+//--------------------------------------------------------------------------
+
+TabContents* TabContents::CreateWithType(TabContentsType type,
+ Profile* profile,
+ SiteInstance* instance) {
+ return new TabContents;
+}
+
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index e6264da..ed710bf 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -26,10 +26,12 @@ class BookmarkService;
class CommandLine;
class HistoryService;
class MetricsService;
+class NavigationController;
class NavigationEntry;
class ProfileManager;
class Profile;
class SessionID;
+class SiteInstance;
class SpellChecker;
class TabContents;
class URLRequestContext;
@@ -172,12 +174,14 @@ class UserDataManager {
struct SessionService {
void WindowClosed(const SessionID &) { }
void SetWindowBounds(const SessionID&, const gfx::Rect&, bool) { }
+ void TabRestored(NavigationController*) { }
};
class TabRestoreService {
public:
void BrowserClosing(Browser*) { }
void BrowserClosed(Browser*) { }
+ void CreateHistoricalTab(NavigationController*) { }
};
class HistoryService {
@@ -277,6 +281,8 @@ void OpenFirstRunDialog(Profile* profile);
void InstallJankometer(const CommandLine&);
+GURL NewTabUIURL();
+
//---------------------------------------------------------------------------
// These stubs are for Browser
@@ -297,14 +303,6 @@ class DebuggerWindow : public base::RefCountedThreadSafe<DebuggerWindow> {
public:
};
-class TabStripModelDelegate {
- public:
-};
-
-class TabStripModelObserver {
- public:
-};
-
class NavigationEntry {
public:
const GURL& url() const { return url_; }
@@ -321,6 +319,7 @@ class NavigationController {
void GoBack() { }
void GoForward() { }
void Reload(bool) { }
+ NavigationController* Clone() { return new NavigationController(); }
TabContents* active_contents() const { return NULL; }
NavigationEntry* GetLastCommittedEntry() const { return entry_.get(); }
NavigationEntry* GetActiveEntry() const { return entry_.get(); }
@@ -345,6 +344,7 @@ class InterstitialPage {
class RenderViewHost {
public:
bool HasUnloadListener() const { return false; }
+ void FirePageBeforeUnload() { }
};
class TabContents {
@@ -359,6 +359,13 @@ class TabContents {
TabContentsType type() const { return TAB_CONTENTS_WEB; }
virtual void Focus() { }
virtual void Stop() { }
+ bool is_loading() const { return false; }
+ void CloseContents() { };
+ void SetupController(Profile* profile) { }
+ static TabContentsType TypeForURL(GURL* url) { return TAB_CONTENTS_WEB; }
+ static TabContents* CreateWithType(TabContentsType type,
+ Profile* profile,
+ SiteInstance* instance);
private:
GURL url_;
std::wstring title_;
@@ -383,29 +390,6 @@ class WebContents : public TabContents {
std::string mime_type_;
};
-// fake a tab strip with one entry.
-class TabStripModel {
- public:
- TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
- : contents_(new WebContents) { }
- virtual ~TabStripModel() { }
- bool empty() const { return contents_.get() == NULL; }
- int count() const { return contents_.get() ? 1 : 0; }
- int selected_index() const { return 0; }
- int GetIndexOfController(const NavigationController* controller) const {
- return 0;
- }
- TabContents* GetTabContentsAt(int index) const { return contents_.get(); }
- TabContents* GetSelectedTabContents() const { return contents_.get(); }
- void SelectTabContentsAt(int index, bool user_gesture) { }
- TabContents* AddBlankTab(bool foreground) { return contents_.get(); }
- void CloseAllTabs() { contents_.reset(NULL); }
- void AddObserver(TabStripModelObserver* observer) { }
- void RemoveObserver(TabStripModelObserver* observer) { }
- private:
- scoped_ptr<TabContents> contents_;
-};
-
class SelectFileDialog : public base::RefCountedThreadSafe<SelectFileDialog> {
public:
class Listener {
@@ -420,6 +404,8 @@ class SiteInstance {
class DockInfo {
public:
+ bool GetNewWindowBounds(gfx::Rect*, bool*) const { return false; }
+ void AdjustOtherWindowBounds() const { }
};
class ToolbarModel {