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

Unified Diff: chrome/browser/ui/search/instant_page.cc

Issue 20501002: Adds paste function to searchbox api and handles paste event on fakebox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 7 years, 4 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/ui/search/instant_page.h ('k') | chrome/browser/ui/search/instant_page_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/instant_page.cc
diff --git a/chrome/browser/ui/search/instant_page.cc b/chrome/browser/ui/search/instant_page.cc
index f963d2df5384b3de64a06d3fb05ccd2a5f4fb756..9149ea742dde8366cf4c459cc863992670eb6e73 100644
--- a/chrome/browser/ui/search/instant_page.cc
+++ b/chrome/browser/ui/search/instant_page.cc
@@ -122,6 +122,10 @@ bool InstantPage::ShouldProcessNavigateToURL() {
return false;
}
+bool InstantPage::ShouldProcessPasteIntoOmnibox() {
+ return false;
+}
+
bool InstantPage::ShouldProcessDeleteMostVisitedItem() {
return false;
}
@@ -143,6 +147,8 @@ bool InstantPage::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusOmnibox, OnFocusOmnibox)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate,
OnSearchBoxNavigate);
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PasteAndOpenDropdown,
+ OnSearchBoxPaste);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CountMouseover, OnCountMouseover);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem,
OnDeleteMostVisitedItem);
@@ -244,6 +250,17 @@ void InstantPage::OnSearchBoxNavigate(int page_id,
contents(), url, transition, disposition, is_search_type);
}
+void InstantPage::OnSearchBoxPaste(int page_id, const string16& text) {
+ if (!contents()->IsActiveEntry(page_id))
+ return;
+
+ SearchTabHelper::FromWebContents(contents())->InstantSupportChanged(true);
+ if (!ShouldProcessPasteIntoOmnibox())
+ return;
+
+ delegate_->PasteIntoOmnibox(contents(), text);
+}
+
void InstantPage::OnCountMouseover(int page_id) {
if (!contents()->IsActiveEntry(page_id))
return;
« no previous file with comments | « chrome/browser/ui/search/instant_page.h ('k') | chrome/browser/ui/search/instant_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698