Remove Profile and HostDesktopType dependencies from core TabRestore code
commit7bf49a3df73ba892210a387735b6d6b52dd88600
authorblundell <blundell@chromium.org>
Mon, 14 Sep 2015 18:38:11 +0000 (14 11:38 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 14 Sep 2015 18:38:48 +0000 (14 18:38 +0000)
treefb55e5cb7b4a00a82cf4fa4126b7e3806de82296
parent89aa05ab8d8a42d2587e5ad3cc6ac245519ce588
Remove Profile and HostDesktopType dependencies from core TabRestore code

The remaining //chrome-level dependencies in core TabRestore code are due to
static methods of TabRestoreServiceDelegate that take in a Profile* and a
chrome::HostDesktopType. This CL replaces the usage of these methods in core
TabRestore code with usage of new methods that have no //chrome-level
dependencies:

(1) Creates corresponding virtual methods on TabRestoreServiceClient, removing
    the need to pass a Profile* (since TabRestoreServiceClient is itself an
    abstraction of Profile).
(2) Changes the reference to chrome::HostDesktopType to be an opaque integer
    representing the host desktop type. This opaque integer is not used by core
    tab restore code.

To move TabRestoreServiceDelegate toward componentization, this CL also removes
those static methods entirely. Once the usage of the TabRestoreServiceDelegate
static methods is removed from core TabRestore code, the only remaining usage
of these methods is in desktop-specific code that knows about Browser. Thus, we
move the declaration of the static methods into
BrowserTabRestoreServiceDelegate.

BUG=530162, 530163

Review URL: https://codereview.chromium.org/1342743002

Cr-Commit-Position: refs/heads/master@{#348663}
22 files changed:
chrome/browser/extensions/api/sessions/sessions_api.cc
chrome/browser/sessions/chrome_tab_restore_service_client.cc
chrome/browser/sessions/chrome_tab_restore_service_client.h
chrome/browser/sessions/in_memory_tab_restore_service.cc
chrome/browser/sessions/in_memory_tab_restore_service.h
chrome/browser/sessions/persistent_tab_restore_service.cc
chrome/browser/sessions/persistent_tab_restore_service.h
chrome/browser/sessions/persistent_tab_restore_service_unittest.cc
chrome/browser/sessions/tab_restore_service.h
chrome/browser/sessions/tab_restore_service_delegate.h
chrome/browser/sessions/tab_restore_service_factory.cc
chrome/browser/sessions/tab_restore_service_helper.cc
chrome/browser/sessions/tab_restore_service_helper.h
chrome/browser/ui/android/tab_restore_service_delegate_android.cc [deleted file]
chrome/browser/ui/browser_tab_restore_service_delegate.cc
chrome/browser/ui/browser_tab_restore_service_delegate.h
chrome/browser/ui/browser_tabrestore_browsertest.cc
chrome/browser/ui/cocoa/history_menu_bridge_unittest.mm
chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc
chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc
chrome/chrome_browser_ui.gypi
components/sessions/core/tab_restore_service_client.h