Start unifying document-mode and tabbed-mode tab creation
commit05c376f220bbffbc20ba6f5d8f1b42091467f12a
authordfalcantara <dfalcantara@chromium.org>
Fri, 12 Jun 2015 01:05:22 +0000 (11 18:05 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 12 Jun 2015 01:05:45 +0000 (12 01:05 +0000)
treec0d4f213de7bf6496e2b096f08339298e3d4f6db
parent2eeecfc4babe46bef3a1a4946a6a77e17b9179fa
Start unifying document-mode and tabbed-mode tab creation

* TabDelegate, which is used to create tabs in document-mode
  now subclasses the TabCreator class that tabbed-mode uses.

* Being consolidating methods for creating tabs in the TabDelegate
  class.

  - Various methods for opening new Tabs under specific conditions
    (e.g. for devtools, or for opening an NTP) in document mode are
    cleaned up.

  - DocumentActivity's SingleTabModelSelector now defers to the
    DocumentTabModelSelector when opening new Tabs.

  - DocumentTabModelImpl uses generic methods in TabDelegate to
    create Tabs as similarly as possible to the TabModelImpl.
    In contrast to how TabModelImpl works with
    ChromeTabbedActivity, the DocumentTabModel has no specific
    Activity to grab TabCreators from.  Instead, the
    DocumentTabModelSelector becomes a TabCreatorManager and
    passes out its TabCreators when necessary.

* TabCreator.createFrozenTab now returns a Tab to line up with how
  document mode creates frozen tabs.

* DocumentTabChromeWebContentsDelegateAndroidImpl no longer stores
  a mapping between the WebContents' URL and its native pointer.
  Instead, the URL is grabbed via JNI before the new Activity is
  launched.

BUG=451453

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

Cr-Commit-Position: refs/heads/master@{#334098}
16 files changed:
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabCreatorManager.java
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImpl.java
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelSelector.java
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/TabDelegate.java
chrome/android/java_staging/src/org/chromium/chrome/browser/ChromeMobileApplication.java
chrome/android/java_staging/src/org/chromium/chrome/browser/document/DocumentActivity.java
chrome/android/java_staging/src/org/chromium/chrome/browser/document/DocumentMigrationHelper.java
chrome/android/java_staging/src/org/chromium/chrome/browser/document/DocumentTab.java
chrome/android/java_staging/src/org/chromium/chrome/browser/document/TabDelegateImpl.java
chrome/android/java_staging/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java
chrome/android/javatests_shell/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java
chrome/android/javatests_shell/src/org/chromium/chrome/browser/tabmodel/document/DocumentTabModelImplTest.java
chrome/android/javatests_shell/src/org/chromium/chrome/browser/tabmodel/document/OffTheRecordDocumentTabModelTest.java
chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockDocumentTabCreatorManager.java [new file with mode: 0644]
chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/tabmodel/document/MockTabDelegate.java