summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/match_preview.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents/match_preview.h')
-rw-r--r--chrome/browser/tab_contents/match_preview.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/match_preview.h b/chrome/browser/tab_contents/match_preview.h
index f699f89..25bb8b7 100644
--- a/chrome/browser/tab_contents/match_preview.h
+++ b/chrome/browser/tab_contents/match_preview.h
@@ -12,6 +12,7 @@
#include "base/timer.h"
#include "chrome/browser/search_engines/template_url_id.h"
#include "chrome/common/page_transition_types.h"
+#include "gfx/rect.h"
#include "googleurl/src/gurl.h"
struct AutocompleteMatch;
@@ -43,6 +44,11 @@ class MatchPreview {
const string16& user_text,
string16* suggested_text);
+ // Sets the bounds of the omnibox (in screen coordinates). The bounds are
+ // remembered until the preview is committed or destroyed. This is only used
+ // when showing results for a search provider that supports instant.
+ void SetOmniboxBounds(const gfx::Rect& bounds);
+
// Destroys the preview TabContents. Does nothing if the preview TabContents
// has not been created.
void DestroyPreviewContents();
@@ -85,6 +91,17 @@ class MatchPreview {
// Invoked once the page has finished loading and the script has been sent.
void PageFinishedLoading();
+ // Returns the bounds of the omnibox in terms of the preview tab contents.
+ gfx::Rect GetOmniboxBoundsInTermsOfPreview();
+
+ // Are we waiting for the preview page to finish loading?
+ bool is_waiting_for_load() const {
+ return frame_load_observer_.get() != NULL;
+ }
+
+ // Are we showing instant results?
+ bool is_showing_instant() const { return template_url_id_ != 0; }
+
MatchPreviewDelegate* delegate_;
// The TabContents last passed to |Update|.
@@ -114,6 +131,9 @@ class MatchPreview {
// the results. A value of 0 means there is no TemplateURL.
TemplateURLID template_url_id_;
+ // See description above setter.
+ gfx::Rect omnibox_bounds_;
+
scoped_ptr<FrameLoadObserver> frame_load_observer_;
DISALLOW_COPY_AND_ASSIGN(MatchPreview);