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

Unified Diff: chrome/browser/instant/instant_overlay_model.h

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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
Index: chrome/browser/instant/instant_overlay_model.h
diff --git a/chrome/browser/instant/instant_overlay_model.h b/chrome/browser/instant/instant_overlay_model.h
index d8203be35cd22e594d6089ca80d77d13e8d2cca6..d002e9e8626bcd9711a0af16f4b25680fe72c950 100644
--- a/chrome/browser/instant/instant_overlay_model.h
+++ b/chrome/browser/instant/instant_overlay_model.h
@@ -8,10 +8,9 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
#include "chrome/common/instant_types.h"
-#include "chrome/common/search_types.h"
-class InstantController;
class InstantOverlayModelObserver;
+class InstantService;
namespace content {
class WebContents;
@@ -21,43 +20,31 @@ class WebContents;
// layout of the Instant overlay.
class InstantOverlayModel {
public:
- explicit InstantOverlayModel(InstantController* controller);
+ explicit InstantOverlayModel(InstantService* service);
~InstantOverlayModel();
- // InstantOverlayModel only uses Mode::mode internally. Other parts of Mode,
- // such as Mode::origin, may have arbitrary values, and should be ignored.
- const chrome::search::Mode& mode() const { return mode_; }
+ content::WebContents* contents() const { return contents_; }
int height() const { return height_; }
InstantSizeUnits height_units() const { return height_units_; }
- void SetOverlayState(const chrome::search::Mode& mode,
+ void SetOverlayState(content::WebContents* contents,
int height,
InstantSizeUnits height_units);
- void SetOverlayContents(content::WebContents* overlay_contents);
- content::WebContents* GetOverlayContents() const;
-
// Add and remove observers.
void AddObserver(InstantOverlayModelObserver* observer);
void RemoveObserver(InstantOverlayModelObserver* observer);
private:
- chrome::search::Mode mode_;
+ content::WebContents* contents_;
int height_;
InstantSizeUnits height_units_;
- // Weak. Remembers the last set overlay contents to detect changes. Actual
- // overlay contents is fetched from the |controller_| as this may not always
- // reflect the actual overlay in effect.
- content::WebContents* overlay_contents_;
-
- // Weak. The controller currently holds some model state.
- // TODO(dhollowa): Remove this, transfer all state to InstantOverlayModel.
- InstantController* const controller_;
-
// Observers.
ObserverList<InstantOverlayModelObserver> observers_;
+ InstantService* const service_;
+
DISALLOW_COPY_AND_ASSIGN(InstantOverlayModel);
};

Powered by Google App Engine
This is Rietveld 408576698