Index: chrome/browser/instant/instant_controller.h |
diff --git a/chrome/browser/instant/instant_controller.h b/chrome/browser/instant/instant_controller.h |
index 2018862cf838069cb9ba0e6d5967c8786f183cf3..f0406ec962b6c0489bcb464277cef5031b339cd4 100644 |
--- a/chrome/browser/instant/instant_controller.h |
+++ b/chrome/browser/instant/instant_controller.h |
@@ -11,6 +11,7 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
+#include "base/gtest_prod_util.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/string16.h" |
#include "base/timer.h" |
@@ -145,11 +146,25 @@ class InstantController : public InstantLoaderDelegate { |
#endif |
private: |
+ FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantLoaderRefresh); |
+ |
// Creates a new loader if necessary (for example, if the |instant_url| has |
// changed since the last time we created the loader). |
void ResetLoader(const std::string& instant_url, |
const TabContents* active_tab); |
+ // Ensures that the |loader_| uses the default Instant Url, recreating it if |
+ // necessary. Will not do anything if the Instant Url could not be determined |
sreeram
2012/08/24 21:06:25
Url -> URL in both lines above.
Shishir
2012/08/24 22:17:39
Done.
|
+ // or the active tab is NULL (browser is shutting down). |
+ void CreateDefaultLoader(); |
+ |
+ // If the |loader_| is not showing, it is deleted and recreated. Else the |
+ // refresh is skipped and the next refresh is scheduled. |
+ void OnStaleLoader(); |
+ |
+ // Calls OnStaleLoader if |stale_loader_timer_| is not running. |
+ void MaybeOnStaleLoader(); |
+ |
// Destroys the |loader_| and its preview contents. |
void DeleteLoader(); |
@@ -218,6 +233,9 @@ class InstantController : public InstantLoaderDelegate { |
// Timer used to update the bounds of the omnibox. |
base::OneShotTimer<InstantController> update_bounds_timer_; |
+ // Timer used to ensure that the Instant page does not get too stale. |
+ base::OneShotTimer<InstantController> stale_loader_timer_; |
+ |
// For each key K => value N, the map says that we found that the search |
// engine identified by Instant URL K didn't support the Instant API in each |
// of the last N times that we loaded it. If an Instant URL isn't present in |