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

Unified Diff: chrome/browser/tab_contents/match_preview.h

Issue 3417011: Makes match preview send the dimensions of the omnibox to the page. (Closed)
Patch Set: Fix unittest Created 10 years, 3 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 | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/tab_contents/match_preview.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/match_preview.h
diff --git a/chrome/browser/tab_contents/match_preview.h b/chrome/browser/tab_contents/match_preview.h
index f699f89af93829f43e54aca82cb212abb6b19994..25bb8b7199da165cf1781be102337aed8add66f6 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);
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/tab_contents/match_preview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698