Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4281)

Unified Diff: chrome/browser/infobars/infobar_container.h

Issue 12036075: alternate ntp: fix website page jankiness when suggestions show and top bars are hidden (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed mechanism to receive PreviewStateChanged Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/infobars/infobar_container.h
diff --git a/chrome/browser/infobars/infobar_container.h b/chrome/browser/infobars/infobar_container.h
index 508bf76dd23826c5d8ecda213526b6d07069a2ea..c3f03305839c3964216ec3006f511cf9dcf68048 100644
--- a/chrome/browser/infobars/infobar_container.h
+++ b/chrome/browser/infobars/infobar_container.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/time.h"
+#include "chrome/browser/instant/instant_model_observer.h"
#include "chrome/browser/ui/search/search_model_observer.h"
#include "chrome/common/search_types.h"
#include "content/public/browser/notification_observer.h"
@@ -33,16 +34,24 @@ class SearchModel;
// Platforms need to subclass this to implement a few platform-specific
// functions, which are pure virtual here.
//
-// This class also observes changes to the SearchModel mode. If the user changes
-// into suggestions mode, it hides all the infobars temporarily. When the user
-// changes back out of suggestions mode, it reshows any infobars, and starts a
-// 50 ms window during which any attempts to re-hide any infobars are handled
-// without animation. This prevents glitchy-looking behavior when the user
-// navigates following a mode change, which otherwise would re-show the infobars
-// only to instantly animate them closed. The window is canceled if a tab
-// change occurs.
+// This class also observes changes to the SearchModel modes. It hides infobars
+// temporarily if the user changes into |SEARCH_SUGGESTIONS| mode (refer to
+// chrome::search::Mode in chrome/common/search_types.h for all search modes)
+// when on a :
+// - |DEFAULT| page: when instant preview is ready;
+// - |NTP| or |SEARCH_RESULTS| page: immediately;
+// TODO(kuan): this scenario requires more complex synchronization with
+// renderer SearchBoxAPI and will be implemented as the next step;
+// for now, hiding is immediate.
+// When the user changes back out of |SEARCH_SUGGESTIONS| mode, it reshows any
+// infobars, and starts a 50 ms window during which any attempts to re-hide any
+// infobars are handled without animation. This prevents glitchy-looking
+// behavior when the user navigates following a mode change, which otherwise
+// would re-show the infobars only to instantly animate them closed. The window
+// to re-hide infobars without animation is canceled if a tab change occurs.
class InfoBarContainer : public content::NotificationObserver,
- public chrome::search::SearchModelObserver {
+ public chrome::search::SearchModelObserver,
+ public InstantModelObserver {
public:
class Delegate {
public:
@@ -101,6 +110,9 @@ class InfoBarContainer : public content::NotificationObserver,
const Delegate* delegate() const { return delegate_; }
+ // InstantModelObserver:
+ virtual void PreviewStateChanged(const InstantModel& model) OVERRIDE;
+
protected:
// Subclasses must call this during destruction, so that we can remove
// infobars (which will call the pure virtual functions below) while the
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698