OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h" | 5 #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_gues t.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 std::string src; | 87 std::string src; |
88 DCHECK(attach_params()->GetString(mime_handler_view::kSrc, &src) && | 88 DCHECK(attach_params()->GetString(mime_handler_view::kSrc, &src) && |
89 !src.empty()); | 89 !src.empty()); |
90 web_contents()->GetController().LoadURL( | 90 web_contents()->GetController().LoadURL( |
91 GURL(src), | 91 GURL(src), |
92 content::Referrer(), | 92 content::Referrer(), |
93 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 93 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
94 std::string()); | 94 std::string()); |
95 } | 95 } |
96 | 96 |
97 void MimeHandlerViewGuest::HandleKeyboardEvent( | |
98 WebContents* source, | |
99 const content::NativeWebKeyboardEvent& event) { | |
100 if (!attached()) | |
101 return; | |
102 | |
103 // Send the keyboard events back to the embedder to reprocess them. | |
104 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard | |
105 // events because the guest may be arbitrarily delayed when responding to | |
106 // keyboard events. In that time, the embedder may have received and processed | |
107 // additional key events. This needs to be fixed as soon as possible. | |
lazyboy
2014/09/08 21:48:36
I'm not sure if the comment is relevant for mime-h
Fady Samuel
2014/09/08 21:51:38
Yes, it is still relevant unfortunately.
| |
108 // See http://crbug.com/229882. | |
109 embedder_web_contents()->GetDelegate()->HandleKeyboardEvent(web_contents(), | |
110 event); | |
111 } | |
112 | |
97 } // namespace extensions | 113 } // namespace extensions |
OLD | NEW |