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

Unified Diff: chrome/renderer/searchbox.h

Issue 10809063: Adding Javascript support for the Extended Searchbox API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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/renderer/searchbox.h
diff --git a/chrome/renderer/searchbox.h b/chrome/renderer/searchbox.h
index 9f3c10443effe2d2ec45613c3615ac61c2d03865..ec97b6045e8d7c2ccf0b61c0d2dfdcbb8fe07a58 100644
--- a/chrome/renderer/searchbox.h
+++ b/chrome/renderer/searchbox.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -21,14 +21,23 @@ class SearchBox : public content::RenderViewObserver,
virtual ~SearchBox();
// Sends ViewHostMsg_SetSuggestions to the browser.
- void SetSuggestions(const std::vector<std::string>& suggestions,
- InstantCompleteBehavior behavior);
+ void SetSuggestions(const std::vector<InstantSuggestion>& suggestions);
+ // Sends ViewHostMsg_SetInstantPreviewHeight to the browser.
+ void SetInstantPreviewHeight(int height, InstantSizeUnits units);
const string16& value() const { return value_; }
bool verbatim() const { return verbatim_; }
uint32 selection_start() const { return selection_start_; }
uint32 selection_end() const { return selection_end_; }
+ int rid_base() const { return rid_base_; }
gfx::Rect GetRect();
+ const std::vector<InstantNativeSuggestionsParts>& native_suggestions() const {
+ return native_suggestions_;
+ }
+ int key_code() const { return key_code_; }
+ const std::string& last_query() const { return last_query_; }
+ const std::string& current_url() const { return current_url_; }
+ bool is_focused() const { return is_focused_; }
private:
// RenderViewObserver implementation.
@@ -45,6 +54,13 @@ class SearchBox : public content::RenderViewObserver,
bool verbatim,
int selection_start,
int selection_end);
+ void OnNativeSuggestions(
+ const std::vector<InstantNativeSuggestionsParts>& native_suggestions);
+ void OnKeyPress(int key_code);
+ void OnLastQuery(const std::string& last_query);
+ void OnCurrentURL(const std::string& current_url);
+ void OnFocused();
+ void OnBlurred();
// Sets the searchbox values to their initial value.
void Reset();
@@ -53,7 +69,13 @@ class SearchBox : public content::RenderViewObserver,
bool verbatim_;
uint32 selection_start_;
uint32 selection_end_;
+ int rid_base_;
gfx::Rect rect_;
+ std::vector<InstantNativeSuggestionsParts> native_suggestions_;
+ int key_code_;
+ std::string last_query_;
+ std::string current_url_;
+ bool is_focused_;
DISALLOW_COPY_AND_ASSIGN(SearchBox);
};

Powered by Google App Engine
This is Rietveld 408576698