diff options
Diffstat (limited to 'chrome')
26 files changed, 136 insertions, 84 deletions
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 7184f3c..595220fb 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -11,6 +11,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/history/query_parser.h" +#include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/page_navigator.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/drag_drop_types.h" diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 35e2be0..69fddec 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -60,8 +60,6 @@ #include "chrome/browser/view_ids.h" #include "chrome/browser/views/download_tab_view.h" #include "chrome/browser/views/location_bar_view.h" -#include "chrome/browser/views/new_profile_dialog.h" -#include "chrome/browser/views/select_profile_dialog.h" #include "chrome/browser/window_sizer.h" #include "chrome/common/l10n_util.h" #include "chrome/common/win_util.h" @@ -150,6 +148,18 @@ struct Browser::UIUpdate { unsigned changed_flags; }; +namespace { + +// Returns true if the specified TabContents has unload listeners registered. +bool TabHasUnloadListener(TabContents* contents) { + WebContents* web_contents = contents->AsWebContents(); + return web_contents && web_contents->notify_disconnection() && + !web_contents->showing_interstitial_page() && + web_contents->render_view_host()->HasUnloadListener(); +} + +} // namespace + /////////////////////////////////////////////////////////////////////////////// // Browser, Constructors, Creation, Showing: @@ -414,10 +424,9 @@ bool Browser::ShouldCloseWindow() { is_attempting_to_close_browser_ = true; for (int i = 0; i < tab_count(); ++i) { - if (tabstrip_model_.TabHasUnloadListener(i)) { - TabContents* tab = GetTabContentsAt(i); - tabs_needing_before_unload_fired_.insert(tab); - } + TabContents* contents = GetTabContentsAt(i); + if (TabHasUnloadListener(contents)) + tabs_needing_before_unload_fired_.insert(contents); } if (tabs_needing_before_unload_fired_.empty()) @@ -951,12 +960,12 @@ void Browser::OpenTaskManager() { void Browser::OpenSelectProfileDialog() { UserMetrics::RecordAction(L"SelectProfile", profile_); - SelectProfileDialog::RunDialog(); + window_->ShowSelectProfileDialog(); } void Browser::OpenNewProfileDialog() { UserMetrics::RecordAction(L"CreateProfile", profile_); - NewProfileDialog::RunDialog(); + window_->ShowNewProfileDialog(); } void Browser::OpenBugReportDialog() { @@ -1361,6 +1370,40 @@ void Browser::CloseFrameAfterDragSession() { method_factory_.NewRunnableMethod(&Browser::CloseFrame)); } +void Browser::CreateHistoricalTab(TabContents* contents) { + // We don't create historical tabs for incognito windows or windows without + // profiles. + if (!profile() || profile()->IsOffTheRecord() || + !profile()->GetTabRestoreService()) { + return; + } + + // We only create historical tab entries for normal tabbed browser windows. + if (type() == TYPE_NORMAL) { + profile()->GetTabRestoreService()->CreateHistoricalTab( + contents->controller()); + } +} + +bool Browser::RunUnloadListenerBeforeClosing(TabContents* contents) { + WebContents* web_contents = contents->AsWebContents(); + if (web_contents) { + // If the WebContents is not connected yet, then there's no unload + // handler we can fire even if the WebContents has an unload listener. + // One case where we hit this is in a tab that has an infinite loop + // before load. + if (TabHasUnloadListener(contents)) { + // If the page has unload listeners, then we tell the renderer to fire + // them. Once they have fired, we'll get a message back saying whether + // to proceed closing the page or not, which sends us back to this method + // with the HasUnloadListener bit cleared. + web_contents->render_view_host()->FirePageBeforeUnload(); + return true; + } + } + return false; +} + /////////////////////////////////////////////////////////////////////////////// // Browser, TabStripModelObserver implementation: diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index b824969..1e1875b 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -351,6 +351,8 @@ class Browser : public TabStripModelDelegate, #if defined(OS_WIN) virtual void DuplicateContentsAt(int index); virtual void CloseFrameAfterDragSession(); + virtual void CreateHistoricalTab(TabContents* contents); + virtual bool RunUnloadListenerBeforeClosing(TabContents* contents); // Overridden from TabStripModelObserver: virtual void TabInsertedAt(TabContents* contents, diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index e86290f..b65d88c 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -26,6 +26,7 @@ #include "chrome/browser/first_run.h" #include "chrome/browser/net/dns_global.h" #include "chrome/browser/net/url_fixer_upper.h" +#include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/session_startup_pref.h" #include "chrome/browser/sessions/session_restore.h" #include "chrome/browser/tab_contents/infobar_delegate.h" diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index 01cbf6a..38f32b4 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -136,6 +136,12 @@ class BrowserWindow { // Shows the Password Manager dialog box. virtual void ShowPasswordManager() = 0; + // Shows the Select Profile dialog box. + virtual void ShowSelectProfileDialog() = 0; + + // Shows the New Profile dialog box. + virtual void ShowNewProfileDialog() = 0; + // Shows a dialog box with HTML content, e.g. for Gears. |parent_window| is // the window the dialog should be opened modal to and is a native window // handle. diff --git a/chrome/browser/browser_window_cocoa.h b/chrome/browser/browser_window_cocoa.h index 1891b04..88d9fed 100644 --- a/chrome/browser/browser_window_cocoa.h +++ b/chrome/browser/browser_window_cocoa.h @@ -52,6 +52,8 @@ class BrowserWindowCocoa : public BrowserWindow { virtual void ShowImportDialog(); virtual void ShowSearchEnginesDialog(); virtual void ShowPasswordManager(); + virtual void ShowSelectProfileDialog(); + virtual void ShowNewProfileDialog(); virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window); diff --git a/chrome/browser/browser_window_cocoa.mm b/chrome/browser/browser_window_cocoa.mm index 92454f1..095600f 100644 --- a/chrome/browser/browser_window_cocoa.mm +++ b/chrome/browser/browser_window_cocoa.mm @@ -135,6 +135,12 @@ void BrowserWindowCocoa::ShowSearchEnginesDialog() { void BrowserWindowCocoa::ShowPasswordManager() { } +void BrowserWindowCocoa::ShowSelectProfileDialog() { +} + +void BrowserWindowCocoa::ShowNewProfileDialog() { +} + void BrowserWindowCocoa::ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window) { } diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index f501764..5ea298e 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -23,6 +23,7 @@ #include "chrome/browser/plugin_process_host.h" #include "chrome/browser/plugin_service.h" #include "chrome/browser/profile.h" +#include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_counters.h" #include "chrome/common/chrome_paths.h" diff --git a/chrome/browser/external_protocol_handler.cc b/chrome/browser/external_protocol_handler.cc index 18ff2bf..ff55afa 100644 --- a/chrome/browser/external_protocol_handler.cc +++ b/chrome/browser/external_protocol_handler.cc @@ -12,6 +12,7 @@ #include "base/message_loop.h" #include "base/registry.h" #include "base/scoped_ptr.h" +#include "base/thread.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process_impl.h" #include "chrome/browser/views/external_protocol_dialog.h" diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index f73e443..6e68c98 100755 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -22,6 +22,7 @@ #include "chrome/browser/importer/ie_importer.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/shell_integration.h" +#include "chrome/browser/tab_contents/site_instance.h" #include "chrome/browser/views/importer_lock_view.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/gfx/favicon_size.h" diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc index 1cbf815..3ea79ff 100644 --- a/chrome/browser/net/dns_global.cc +++ b/chrome/browser/net/dns_global.cc @@ -14,6 +14,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/net/dns_host_info.h" #include "chrome/browser/net/referrer.h" +#include "chrome/browser/profile.h" #include "chrome/browser/session_startup_pref.h" #include "chrome/common/notification_types.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index fab4dd45..6a2c139 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -15,6 +15,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/tab_contents/navigation_controller.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/l10n_util.h" diff --git a/chrome/browser/renderer_host/test_render_view_host.h b/chrome/browser/renderer_host/test_render_view_host.h index 13e705e..6741067 100644 --- a/chrome/browser/renderer_host/test_render_view_host.h +++ b/chrome/browser/renderer_host/test_render_view_host.h @@ -7,11 +7,12 @@ #include "base/basictypes.h" #include "base/message_loop.h" -#include "chrome/browser/tab_contents/navigation_controller.h" -#include "chrome/browser/tab_contents/test_web_contents.h" #include "chrome/browser/renderer_host/mock_render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host_view.h" +#include "chrome/browser/tab_contents/navigation_controller.h" +#include "chrome/browser/tab_contents/site_instance.h" +#include "chrome/browser/tab_contents/test_web_contents.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/sessions/session_types.h b/chrome/browser/sessions/session_types.h index deabead..2e80931 100644 --- a/chrome/browser/sessions/session_types.h +++ b/chrome/browser/sessions/session_types.h @@ -12,6 +12,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/sessions/session_id.h" #include "chrome/common/page_transition_types.h" +#include "chrome/common/stl_util-inl.h" #include "googleurl/src/gurl.h" class NavigationEntry; diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc index 5f1016a..0c7cbef 100644 --- a/chrome/browser/tab_contents/web_contents_view_win.cc +++ b/chrome/browser/tab_contents/web_contents_view_win.cc @@ -7,9 +7,10 @@ #include <windows.h> #include "chrome/browser/bookmarks/bookmark_drag_data.h" -#include "chrome/browser/browser.h" +#include "chrome/browser/browser.h" // TODO(beng): this dependency is awful. #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_request_manager.h" +#include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host_view_win.h" #include "chrome/browser/tab_contents/render_view_context_menu.h" diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 2599382..938bd74 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -2,25 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/tabs/tab_strip_model.h" + #include <algorithm> -#include "base/gfx/point.h" -#include "base/logging.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/browser_about_handler.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profile.h" -#include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/browser/sessions/tab_restore_service.h" #include "chrome/browser/tab_contents/navigation_controller.h" -#include "chrome/browser/tab_contents/navigation_entry.h" -#include "chrome/browser/tab_contents/tab_contents_factory.h" -#include "chrome/browser/tabs/tab_strip_model.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tabs/tab_strip_model_order_controller.h" -#include "chrome/common/notification_service.h" -#include "chrome/common/pref_names.h" -#include "chrome/common/pref_service.h" #include "chrome/common/stl_util-inl.h" /////////////////////////////////////////////////////////////////////////////// @@ -235,23 +225,6 @@ bool TabStripModel::TabsAreLoading() const { return false; } -bool TabStripModel::TabHasUnloadListener(int index) { - // TODO(beng): this should call through to the delegate, so we can mock it - // in testing and then provide better test coverage for features - // like "close other tabs". - WebContents* web_contents = GetContentsAt(index)->AsWebContents(); - if (web_contents) { - // If the WebContents is not connected yet, then there's no unload - // handler we can fire even if the WebContents has an unload listener. - // One case where we hit this is in a tab that has an infinite loop - // before load. - return web_contents->notify_disconnection() && - !web_contents->showing_interstitial_page() && - web_contents->render_view_host()->HasUnloadListener(); - } - return false; -} - NavigationController* TabStripModel::GetOpenerOfTabContentsAt(int index) { DCHECK(ContainsIndex(index)); return contents_data_.at(index)->opener; @@ -528,17 +501,8 @@ bool TabStripModel::InternalCloseTabContentsAt(int index, bool create_historical_tab) { TabContents* detached_contents = GetContentsAt(index); - if (TabHasUnloadListener(index)) { - // If the page has unload listeners, then we tell the renderer to fire - // them. Once they have fired, we'll get a message back saying whether - // to proceed closing the page or not, which sends us back to this method - // with the HasUnloadListener bit cleared. - WebContents* web_contents = detached_contents->AsWebContents(); - // If we hit this code path, the tab had better be a WebContents tab. - DCHECK(web_contents); - web_contents->render_view_host()->FirePageBeforeUnload(); + if (delegate_->RunUnloadListenerBeforeClosing(detached_contents)) return false; - } // TODO: Now that we know the tab has no unload/beforeunload listeners, // we should be able to do a fast shutdown of the RenderViewProcess. @@ -547,14 +511,12 @@ bool TabStripModel::InternalCloseTabContentsAt(int index, FOR_EACH_OBSERVER(TabStripModelObserver, observers_, TabClosingAt(detached_contents, index)); - const bool add_to_restore_service = - (detached_contents && create_historical_tab && - ShouldAddToTabRestoreService(detached_contents)); if (detached_contents) { - if (add_to_restore_service) { - profile()->GetTabRestoreService()-> - CreateHistoricalTab(detached_contents->controller()); - } + // Ask the delegate to save an entry for this tab in the historical tab + // database if applicable. + if (create_historical_tab) + delegate_->CreateHistoricalTab(detached_contents); + detached_contents->CloseContents(); // Closing the TabContents will later call back to us via // NotificationObserver and detach it. @@ -589,19 +551,6 @@ void TabStripModel::SetOpenerForContents(TabContents* contents, contents_data_.at(index)->opener = opener->controller(); } -bool TabStripModel::ShouldAddToTabRestoreService(TabContents* contents) { - if (!profile() || profile()->IsOffTheRecord() || - !profile()->GetTabRestoreService()) { - return false; - } - - Browser* browser = - Browser::GetBrowserForController(contents->controller(), NULL); - if (!browser) - return false; // Browser is null during unit tests. - return browser->type() == Browser::TYPE_NORMAL; -} - // static bool TabStripModel::OpenerMatches(TabContentsData* data, NavigationController* opener, diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 0e5ceea..a9a6578 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -7,21 +7,19 @@ #include <vector> -#include "base/basictypes.h" #include "base/observer_list.h" -#include "chrome/browser/history/history.h" -#include "chrome/browser/tab_contents/site_instance.h" #include "chrome/common/notification_service.h" #include "chrome/common/page_transition_types.h" -#include "chrome/common/pref_member.h" namespace gfx { class Point; +class Rect; } class DockInfo; class GURL; class NavigationController; class Profile; +class SiteInstance; class TabContents; class TabStripModelOrderController; class TabStripModel; @@ -132,6 +130,17 @@ class TabStripModelDelegate { // Called when a drag session has completed and the frame that initiated the // the session should be closed. virtual void CloseFrameAfterDragSession() = 0; + + // Creates an entry in the historical tab database for the specified + // TabContents. + virtual void CreateHistoricalTab(TabContents* contents) = 0; + + // Runs any unload listeners associated with the specified TabContents before + // it is closed. If there are unload listeners that need to be run, this + // function returns true and the TabStripModel will wait before closing the + // TabContents. If it returns false, there are no unload listeners and the + // TabStripModel can close the TabContents immediately. + virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) = 0; }; //////////////////////////////////////////////////////////////////////////////// @@ -286,10 +295,6 @@ class TabStripModel : public NotificationObserver { // Returns true if there are any TabContents that are currently loading. bool TabsAreLoading() const; - // Whether the tab has a beforeunload/unload listener that needs firing before - // being closed. - bool TabHasUnloadListener(int index); - // Returns the controller controller that opened the TabContents at |index|. NavigationController* GetOpenerOfTabContentsAt(int index); @@ -423,11 +428,6 @@ class TabStripModel : public NotificationObserver { // be |opener|'s NavigationController. void SetOpenerForContents(TabContents* contents, TabContents* opener); - // Returns true if closing the tab should add it to TabRestoreService. This - // returns true only if the profile has a TabRestoreService and the browser - // type is TABBED_BROWSER. - bool ShouldAddToTabRestoreService(TabContents* contents); - // Returns true if the tab represented by the specified data has an opener // that matches the specified one. If |use_group| is true, then this will // fall back to check the group relationship as well. diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index 21ea248..84b3ceb 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -1012,6 +1012,10 @@ class TabStripDummyDelegate : public TabStripModelDelegate { virtual bool CanDuplicateContentsAt(int index) { return false; } virtual void DuplicateContentsAt(int index) {} virtual void CloseFrameAfterDragSession() {} + virtual void CreateHistoricalTab(TabContents* contents) {} + virtual bool RunUnloadListenerBeforeClosing(TabContents* contents) { + return false; + } private: // A dummy TabContents we give to callers that expect us to actually build a diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 14a3e14..4582049 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -7,6 +7,7 @@ #include "base/process_util.h" #include "base/stats_table.h" #include "base/string_util.h" +#include "base/thread.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc index 25b01db..ad97219 100644 --- a/chrome/browser/views/first_run_bubble.cc +++ b/chrome/browser/views/first_run_bubble.cc @@ -10,6 +10,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/options_window.h" +#include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/browser/views/standard_layout.h" #include "chrome/common/l10n_util.h" diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 7b6909e..b3229c9 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -26,7 +26,9 @@ #include "chrome/browser/views/importer_view.h" #include "chrome/browser/views/infobars/infobar_container.h" #include "chrome/browser/views/keyword_editor_view.h" +#include "chrome/browser/views/new_profile_dialog.h" #include "chrome/browser/views/password_manager_view.h" +#include "chrome/browser/views/select_profile_dialog.h" #include "chrome/browser/views/status_bubble_views.h" #include "chrome/browser/views/tab_contents_container_view.h" #include "chrome/browser/views/tabs/tab_strip.h" @@ -605,6 +607,14 @@ void BrowserView::ShowPasswordManager() { PasswordManagerView::Show(browser_->profile()); } +void BrowserView::ShowSelectProfileDialog() { + SelectProfileDialog::RunDialog(); +} + +void BrowserView::ShowNewProfileDialog() { + NewProfileDialog::RunDialog(); +} + void BrowserView::ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window) { HWND parent_hwnd = reinterpret_cast<HWND>(parent_window); diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 891f288..39c2532 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -179,6 +179,8 @@ class BrowserView : public BrowserWindow, virtual void ShowImportDialog(); virtual void ShowSearchEnginesDialog(); virtual void ShowPasswordManager(); + virtual void ShowSelectProfileDialog(); + virtual void ShowNewProfileDialog(); virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window); diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 86b2d6b..8c7ca7a 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -7,6 +7,7 @@ #include "chrome/app/result_codes.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/views/standard_layout.h" #include "chrome/browser/tab_contents/web_contents.h" diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 2278437..640b0e3 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -8,6 +8,7 @@ #include "chrome/app/theme/theme_resources.h" #include "chrome/browser/browser.h" +#include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/common/gfx/chrome_canvas.h" diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 97de3fb0..aad59bd 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -298,6 +298,11 @@ class InterstitialPage { virtual void DontProceed() { } }; +class RenderViewHost { + public: + bool HasUnloadListener() const { return false; } +}; + class TabContents { public: TabContents() : controller_(new NavigationController) { } @@ -323,7 +328,14 @@ class WebContents : public TabContents { InterstitialPage* interstitial_page() const { return NULL; } bool is_starred() const { return false; } const std::string& contents_mime_type() const { return mime_type_; } + bool notify_disconnection() const { return false; } + RenderViewHost* render_view_host() const { + return const_cast<RenderViewHost*>(&render_view_host_); + } + private: + RenderViewHost render_view_host_; + std::string mime_type_; }; diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h index 901c12b..29ab2bc 100644 --- a/chrome/test/test_browser_window.h +++ b/chrome/test/test_browser_window.h @@ -51,6 +51,8 @@ class TestBrowserWindow : public BrowserWindow { virtual void ShowImportDialog() {} virtual void ShowSearchEnginesDialog() {} virtual void ShowPasswordManager() {} + virtual void ShowSelectProfileDialog() {} + virtual void ShowNewProfileDialog() {} virtual void ShowHTMLDialog(HtmlDialogContentsDelegate* delegate, void* parent_window) {} |