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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 1833133002: Disallow paste in readonly omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use specialized IsCommandIdEnabled Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 533f98421d2e5b5750f68a4c53879768f83f1de0..36fa30effefcfa784eb4f108f56a6e5acde17164 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -370,7 +370,8 @@ void OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) {
// These commands do invoke the popup.
case IDS_APP_PASTE:
- OnPaste();
+ if (IsCommandIdEnabled(command_id))
+ OnPaste();
return;
default:
if (Textfield::IsCommandIdEnabled(command_id)) {
@@ -765,12 +766,12 @@ bool OmniboxViewViews::OnKeyPressed(const ui::KeyEvent& event) {
}
break;
case ui::VKEY_PRIOR:
- if (control || alt || shift)
+ if (read_only() || control || alt || shift)
return false;
model()->OnUpOrDownKeyPressed(-1 * model()->result().size());
return true;
case ui::VKEY_NEXT:
- if (control || alt || shift)
+ if (read_only() || control || alt || shift)
return false;
model()->OnUpOrDownKeyPressed(model()->result().size());
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698