[Home] Ensure incognito tab model is created when NTP opened
With the new Chrome Home NTP design, a new tab object is not created
until the user selects content in the bottom sheet. Previously the
incognito profile was not created until a new tab object was created.
This change introduces a TabModel#setIsPendingTabAdd() method that allows
the BottomSheetNewTabController to tell the incognito tab model when
a new tab may be created soon. This is used to ensure the incognito
profile is created and used for things like the autocomplete controller,
bookmarks bridge, etc. When the bottom sheet is closed, another call
to #setIsPendingTabAdd() allows the incognito tab model to destroy the
incognito profile if necessary.
Additionally, TabWindowManager has a new #canDestroyIncognitoProfile()
method that checks selectors for pending tab adds. This method is used
to guard incognito profile destruction.
BUG=
725399,
695973,
725413
Review-Url:
https://codereview.chromium.org/2899053004
Cr-Commit-Position: refs/heads/master@{#474521}
Committed:
https://chromium.googlesource.com/chromium/src/+/4e98ce65239c3022133064637835602cb3d458c2