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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return true; | 140 return true; |
141 } | 141 } |
142 return false; | 142 return false; |
143 } | 143 } |
144 | 144 |
145 void MimeHandlerViewGuest::ContentsZoomChange(bool zoom_in) { | 145 void MimeHandlerViewGuest::ContentsZoomChange(bool zoom_in) { |
146 if (delegate_) | 146 if (delegate_) |
147 delegate_->ChangeZoom(zoom_in); | 147 delegate_->ChangeZoom(zoom_in); |
148 } | 148 } |
149 | 149 |
| 150 bool MimeHandlerViewGuest::HandleContextMenu( |
| 151 const content::ContextMenuParams& params) { |
| 152 if (delegate_) |
| 153 return delegate_->HandleContextMenu(web_contents(), params); |
| 154 |
| 155 return false; |
| 156 } |
| 157 |
150 void MimeHandlerViewGuest::HandleKeyboardEvent( | 158 void MimeHandlerViewGuest::HandleKeyboardEvent( |
151 WebContents* source, | 159 WebContents* source, |
152 const content::NativeWebKeyboardEvent& event) { | 160 const content::NativeWebKeyboardEvent& event) { |
153 if (!attached()) | 161 if (!attached()) |
154 return; | 162 return; |
155 | 163 |
156 // Send the keyboard events back to the embedder to reprocess them. | 164 // Send the keyboard events back to the embedder to reprocess them. |
157 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard | 165 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard |
158 // events because the guest may be arbitrarily delayed when responding to | 166 // events because the guest may be arbitrarily delayed when responding to |
159 // keyboard events. In that time, the embedder may have received and processed | 167 // keyboard events. In that time, the embedder may have received and processed |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 199 |
192 void MimeHandlerViewGuest::OnRequest( | 200 void MimeHandlerViewGuest::OnRequest( |
193 const ExtensionHostMsg_Request_Params& params) { | 201 const ExtensionHostMsg_Request_Params& params) { |
194 if (extension_function_dispatcher_) { | 202 if (extension_function_dispatcher_) { |
195 extension_function_dispatcher_->Dispatch( | 203 extension_function_dispatcher_->Dispatch( |
196 params, web_contents()->GetRenderViewHost()); | 204 params, web_contents()->GetRenderViewHost()); |
197 } | 205 } |
198 } | 206 } |
199 | 207 |
200 } // namespace extensions | 208 } // namespace extensions |
OLD | NEW |