diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 16:20:36 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 16:20:36 +0000 |
commit | 2573b8d3757a212c949412d344cfe568b3a2fe9e (patch) | |
tree | ddd36b1cf34d858b032e2fced703da416a87ca20 /chrome/browser/instant/instant_controller.h | |
parent | d75695a9cc2493f72c1cdaddcb5a9adef76ce2fc (diff) | |
download | chromium_src-2573b8d3757a212c949412d344cfe568b3a2fe9e.zip chromium_src-2573b8d3757a212c949412d344cfe568b3a2fe9e.tar.gz chromium_src-2573b8d3757a212c949412d344cfe568b3a2fe9e.tar.bz2 |
Minor cleanup of InstantController. Consolidates notifying the
delegate to a single method.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6580047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_controller.h')
-rw-r--r-- | chrome/browser/instant/instant_controller.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h index 5596910..bc535f8 100644 --- a/chrome/browser/instant/instant_controller.h +++ b/chrome/browser/instant/instant_controller.h @@ -143,7 +143,7 @@ class InstantController : public InstantLoaderDelegate { // Returns true if the preview TabContents is ready to be displayed. In some // situations this may return false yet GetPreviewContents() returns non-NULL. - bool is_displayable() const { return is_displayable_; } + bool is_displayable() const { return displayable_loader_ != NULL; } // Returns the transition type of the last AutocompleteMatch passed to Update. PageTransition::Type last_transition_type() const { @@ -188,6 +188,9 @@ class InstantController : public InstantLoaderDelegate { typedef std::set<std::string> HostBlacklist; + // Updates |displayable_loader_| and if necessary notifies the delegate. + void UpdateDisplayableLoader(); + // Returns the TabContents of the pending loader (or NULL). This is only used // for testing. TabContentsWrapper* GetPendingPreviewContents(); @@ -247,9 +250,8 @@ class InstantController : public InstantLoaderDelegate { // See description above getter for details. bool is_active_; - // Has notification been sent out that the preview TabContents is ready to be - // shown? - bool is_displayable_; + // The loader that is ready to be displayed. + InstantLoader* displayable_loader_; // See description above setter. gfx::Rect omnibox_bounds_; @@ -268,6 +270,7 @@ class InstantController : public InstantLoaderDelegate { // reset/commit. std::set<TemplateURLID> blacklisted_ids_; + // Timer used to delay calls to |UpdateLoader|. base::OneShotTimer<InstantController> update_timer_; // Used by ScheduleForDestroy; see it for details. |