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

Unified Diff: chrome/browser/instant/instant_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, 10 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_model.h
diff --git a/chrome/browser/instant/instant_model.h b/chrome/browser/instant/instant_model.h
index 42f29c58d8e6532b21382e6547ee229d85bbe624..71f2b3254e6420b6e92c978eb4e393191d40a76b 100644
--- a/chrome/browser/instant/instant_model.h
+++ b/chrome/browser/instant/instant_model.h
@@ -7,57 +7,43 @@
#include "base/basictypes.h"
#include "base/observer_list.h"
-#include "chrome/common/instant_types.h"
-#include "chrome/common/search_types.h"
-class InstantController;
class InstantModelObserver;
+class InstantService;
namespace content {
class WebContents;
}
// Holds state that is important to any views concerned with visibility and
-// layout of the Instant preview.
+// layout of the Instant overlay.
class InstantModel {
samarth 2013/03/01 17:59:53 Calling this InstantModel is very confusing since
sreeram 2013/03/07 18:18:46 Done.
public:
- explicit InstantModel(InstantController* controller);
+ explicit InstantModel(InstantService* service);
~InstantModel();
- // InstantModel 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* overlay() const { return overlay_; }
int height() const { return height_; }
- InstantSizeUnits height_units() const { return height_units_; }
+ bool is_height_in_pixels() const { return is_height_in_pixels_; }
samarth 2013/03/01 17:59:53 Eh, not a fan of this change; I like the explicit
sreeram 2013/03/07 18:18:46 Done. Agreed. Sorry I got overzealous. I also reve
- void SetPreviewState(const chrome::search::Mode& mode,
+ void SetOverlayState(content::WebContents* overlay,
int height,
- InstantSizeUnits height_units);
-
- void SetPreviewContents(content::WebContents* preview_contents);
- content::WebContents* GetPreviewContents() const;
+ bool is_height_in_pixels);
// Add and remove observers.
void AddObserver(InstantModelObserver* observer);
void RemoveObserver(InstantModelObserver* observer);
private:
- chrome::search::Mode mode_;
+ content::WebContents* overlay_;
int height_;
- InstantSizeUnits height_units_;
-
- // Weak. Remembers the last set preview contents to detect changes. Actual
- // preview contents is fetched from the |controller_| as this may not always
- // reflect the actual preview in effect.
- content::WebContents* preview_contents_;
-
- // Weak. The controller currently holds some model state.
- // TODO(dhollowa): Remove this, transfer all model state to InstantModel.
- InstantController* const controller_;
+ bool is_height_in_pixels_;
// Observers.
ObserverList<InstantModelObserver> observers_;
+ InstantService* const service_;
+
DISALLOW_COPY_AND_ASSIGN(InstantModel);
};

Powered by Google App Engine
This is Rietveld 408576698