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

Unified Diff: chrome/renderer/searchbox/searchbox.h

Issue 11359198: Implement the Instant extended API startMargin, endMargin, and rtl properties and the onmarginchang… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/renderer/searchbox/searchbox.h
diff --git a/chrome/renderer/searchbox/searchbox.h b/chrome/renderer/searchbox/searchbox.h
index 2327b27d3e6745103154f664b8e545f38e237e72..0792b24fdb83967714a28c7576d34a27b88a6ee6 100644
--- a/chrome/renderer/searchbox/searchbox.h
+++ b/chrome/renderer/searchbox/searchbox.h
@@ -40,7 +40,14 @@ class SearchBox : public content::RenderViewObserver,
int results_base() const { return results_base_; }
const chrome::search::Mode& mode() const { return mode_; }
- gfx::Rect GetRect();
+ // These functions return the start/end margins of the page text area,
+ // adjusted for the page zoom.
+ int GetStartMargin();
dhollowa 2012/11/28 16:44:08 nit: const
melevin 2012/11/28 20:28:19 Done.
+ int GetEndMargin();
dhollowa 2012/11/28 16:44:08 nit: const
melevin 2012/11/28 20:28:19 Done.
+
+ // Returns the bounds of the Searchbox popup in screen coordinates.
+ gfx::Rect GetPopupBounds();
dhollowa 2012/11/28 16:44:08 nit: const
melevin 2012/11/28 20:28:19 Done.
+
const std::vector<InstantAutocompleteResult>& GetAutocompleteResults();
// Searchbox retains ownership of this object.
const InstantAutocompleteResult*
@@ -58,7 +65,8 @@ class SearchBox : public content::RenderViewObserver,
size_t selection_end);
void OnSubmit(const string16& query);
void OnCancel(const string16& query);
- void OnResize(const gfx::Rect& bounds);
+ void OnPopupResize(const gfx::Rect& bounds);
+ void OnMarginChange(int start, int end);
void OnDetermineIfPageSupportsInstant();
void OnAutocompleteResults(
const std::vector<InstantAutocompleteResult>& results);
@@ -67,6 +75,9 @@ class SearchBox : public content::RenderViewObserver,
void OnThemeChanged(const ThemeBackgroundInfo& theme_info);
void OnThemeAreaHeightChanged(int height);
+ // Returns the current zoom factor of the render view or 1 on failure.
+ double GetZoom();
samarth 2012/11/28 03:51:19 nit: make this const
melevin 2012/11/28 20:28:19 I tried this originally, the compiler was not amus
dhollowa 2012/11/28 20:44:33 That's annoying, but yes, worth a try. You'll wan
melevin 2012/11/28 21:39:23 The code review tool says "jam" isn't a valid user
+
// Sets the searchbox values to their initial value.
void Reset();
@@ -75,7 +86,9 @@ class SearchBox : public content::RenderViewObserver,
size_t selection_start_;
size_t selection_end_;
size_t results_base_;
- gfx::Rect rect_;
+ int start_margin_;
+ int end_margin_;
+ gfx::Rect popup_bounds_;
std::vector<InstantAutocompleteResult> autocomplete_results_;
size_t last_results_base_;
std::vector<InstantAutocompleteResult> last_autocomplete_results_;

Powered by Google App Engine
This is Rietveld 408576698