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

Unified Diff: chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc

Issue 738323002: OOP PDF: Forward keyboard events to a constrained web dialog's initiator's delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« 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/constrained_web_dialog_delegate_views.cc
diff --git a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
index 42857f0e42d0f8269c9fedc1a91991c1ca6c179c..c98917173b820a6ed5319febb73e00ea237ce188 100644
--- a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
+++ b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
@@ -41,13 +41,14 @@ class WebDialogWebContentsDelegateViews
void HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override {
- // Forward shortcut keys in dialog to the browser. http://crbug.com/104586
+ // Forward shortcut keys in dialog to our initiator's delegate.
+ // http://crbug.com/104586
// Disabled on Mac due to http://crbug.com/112173
#if !defined(OS_MACOSX)
- Browser* current_browser = chrome::FindBrowserWithWebContents(initiator_);
- if (!current_browser)
+ auto delegate = initiator_->GetDelegate();
+ if (!delegate)
return;
- current_browser->window()->HandleKeyboardEvent(event);
+ delegate->HandleKeyboardEvent(initiator_, event);
#endif
}
« 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