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

Unified Diff: chrome/browser/ui/browser_instant_controller.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: Test updated Created 7 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/browser/ui/browser_instant_controller.cc
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index c36cad8f18c4a95cdad1b152c92d0a5434947b9f..3082799b6dcb1ae3edb463e8027d699a293e188c 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -189,6 +189,18 @@ void BrowserInstantController::OpenURL(
false));
}
+void BrowserInstantController::PasteIntoOmnibox() {
+ OmniboxView* omnibox_view = browser_->window()->GetLocationBar()->
+ GetLocationEntry();
+ string16 clipboardText = omnibox_view->GetClipboardText();
+
+ if (!clipboardText.empty()) {
+ omnibox_view->OnBeforePossibleChange();
+ omnibox_view->SetUserText(clipboardText);
samarth 2013/07/26 22:51:41 I think you also want to call omnibox_view->model(
jfweitz 2013/07/29 18:48:25 Done.
+ omnibox_view->OnAfterPossibleChange();
+ }
+}
+
void BrowserInstantController::SetOmniboxBounds(const gfx::Rect& bounds) {
instant_.SetOmniboxBounds(bounds);
}

Powered by Google App Engine
This is Rietveld 408576698