Refactor Instant to separate out preview control
Separates out Show/Hide logic into a separate |InstantPreviewController|
class. This class follows an observer pattern, observing the |InstantModel|
changes. The model is held by the |InstantController|.
The goal with this is to pave the way for future changes that will expand the
complexity of the "view" logic, especially in the area of coordinating the
animations used with --enable-instant-extended-api features.
BUG=142785
TEST=No functional change. Refactoring only.
[email protected], [email protected], [email protected]
Review URL: https://chromiumcodereview.appspot.com/11144004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162633 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 6b35042..bca5105e 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -62,15 +62,6 @@
////////////////////////////////////////////////////////////////////////////////
// BrowserInstantController, InstantControllerDelegate implementation:
-void BrowserInstantController::ShowInstant(int height, InstantSizeUnits units) {
- browser_->window()->ShowInstant(instant_->GetPreviewContents(),
- height, units);
-}
-
-void BrowserInstantController::HideInstant() {
- browser_->window()->HideInstant();
-}
-
void BrowserInstantController::CommitInstant(TabContents* preview,
bool in_new_tab) {
if (in_new_tab) {
@@ -154,6 +145,12 @@
!browser_shutdown::ShuttingDownWithoutClosingBrowsers() &&
browser_->is_type_tabbed() ?
InstantController::CreateInstant(browser_->profile(), this) : NULL);
+
+ // Notify any observers that they need to reset.
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_BROWSER_INSTANT_RESET,
+ content::Source<BrowserInstantController>(this),
+ content::NotificationService::NoDetails());
}
} // namespace chrome